PDA

View Full Version : OnValidate on cWebColumn works only when changing rows but not when changing focus on same row column on non-dataaware cWebGr



Takashi Arikuma
20-Feb-2014, 04:52 PM
I have a non-dataaware cWebGrid with a column with a validation. The validation is simple: if the value of the column is between 1001 and 1002 is okay. If I enter a value like 999999 the OnValidate event thru and returns a False, that's okay, but if the focus is lost to another column of the same row the event doesn't back the focus to the column. It works only when changing to another row.

Another weird behavior is the following: if I enter on the first row 9999 and press tab the focus changes to the next column, but the OnValidate returns False. After I back to the column and write back the original value "1001" and with the "mouse" click on the next row the OnValidate returns True and the values of the first row clears all.

kelly
21-Feb-2014, 01:10 AM
Please can you use shorter subjects. Once saved they cut off part of the text as has happened above. Also when they get archived it's hard to see at a glance what the thread is about.

TIA

Harm Wibier
21-Feb-2014, 08:40 AM
Note that it is common practice to use showControlError to display an error within the OnValidate method. But still the focus will go to the next column and that is something that we will see if we can improve on.

The row clearing is definitely a bug and is something that we will look into.

Takashi Arikuma
21-Feb-2014, 09:28 AM
You right Kelly... Next time I will be more careful...

Takashi Arikuma
21-Feb-2014, 09:39 AM
Hi Harm,

Yes previously I used ShowControlError method with the same result, but sent the code without it to keep the code simple.
Hoping to have a solution to both problem!!!

Takashi Arikuma
26-Feb-2014, 08:05 PM
Same behavior in alpha 2 for the OnValidate when changing column on the same row.

The row clearing bug issue too.

Takashi

Harm Wibier
27-Feb-2014, 03:45 AM
Yes, the fix for this didn't make it into Alpha 2. It will be in the next release.

Klaus Berthelsen
27-Feb-2014, 08:42 AM
MoveToPreviousColumn could do as a workaround. Works also in 17.1

Takashi Arikuma
27-Feb-2014, 09:58 AM
Excellent Klaus!!! Thank you!!! Works perfect... That's key meanwhile... Works perfect on 17.1 and on new SP 17.1.38.0.
Also on 18.0 Alpha 2.
Just needed to fix the line clearing error that not happen in version 17.1.