PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → Performing a check exiting from a cell, values not current but previous
Performing a check exiting from a cell, values not current but previous
Started by busfra, Dec., 18 2018 12:28 PM - No answer
Registered member
19 messages
Posted on December, 18 2018 - 12:28 PM
Good morning
in Webdev 23 last update 53k, after some bad tests, I think there is a bug (but I hope I'm wrong..)
I try to explain
I have a page with an Ajax table control based on a db table
I'm trying to make some check on the values exiting from a single cell of this table control
I see that I can do that ONLY by calling an Ajax procedure on the code, browser side.
Then, in my "Exit with modification" (OnChange) code or "Control Exit"(on blur) I put an AjaxExecute to my procedure.
In order that I can't refer directly to a table column in Browser code, I want pass to my procedure a string containing the name of that control (table.column).
In my Procedure then I read by indirection the value of the cell.
The problem (I think a bug) is that the call returns always the value BEFORE the modification, the previous value
In fact I try this:
- I write "Test" in the cell
- the event fires
- my procedure receives the name of the column and the indirection get an empty field
- I return to the cell
- I update the value in "After test"
- the event fires and the procedure returns "Test" (the "before" value)

Am I wrong?
Is there another way to perform a check on the table cell value?

Another question please: in the same table I set the input size of a text column, but, at runtime, the input is not stopped to the requested size (in a form all is right): why?

Follows code of tha Ajax call and my Ajax procedure

// ONCHANGE (browser)

IF AJAXAvailable() = True THEN
Res is string
Res = AJAXExecute(ajaxUpdateControls,CheckObjectSize,"PAGE_Form_Tranfer_Goods.TABLE_Smt_p_transfergoodsdetails.COL_MaterialCode")
END

=======================
//Global procedure
PROCEDURE CheckObjectSize(sControl is string)
cmd_testedValue is string = {sControl+"..Value"}
cmd_linkfile is string= {sControl+"..FileLink"}
aa is string = smt_p_transfergoodsdetails.MaterialCode..Size
cmd_sizeOnDB is int = {cmd_linkfile}..Size

ToastDisplay(cmd_testedValue)

IF Length(cmd_testedValue) > cmd_sizeOnDB THEN
RESULT False

END
RESULT True


Thanks
Franco