Issues in Selecting Radio Buttons in Table View

Hi All,

I have a Field, with Yes/No Option and the form is in table view. User can select either option(Yes/No). I have a method attached to the onFocousGained() Event to this field. In the Method, I have one one line of Code.

databasemanager.saveData();

I have noticed an unusual behavior. When I am going to data mode, for the first time, if the selected value was “Yes”, and trying to select “No”, I can able to select the same(Value “No”) after three clicks. While, If the Value was “No” at the starting, I can able to select “Yes” only a single Click.

The Unusual behavior is coming if the value is “Yes” at the start up. It only shows once.

If you again want to notice the behavior, Go to Design Mode & come back again to Data mode & try to select the value, which has the value “Yes” previously selected.

The above behavior is noticed in Servoy 4.0 also.

Servoy Developer
Version 3.5.2-build 515
Java version 10.0-b22 (Windows XP)

so you are saving data in the onfocus event?
Cant you do that on the ondatachange event? so after the fact not before?

jcompagner:
so you are saving data in the onfocus event?
Cant you do that on the ondatachange event? so after the fact not before?

Hi Johan,

I can made that to ondatachange event, but the issue there is if we have change something, it won’t be get saved until we click outside(I have also tried by using the databaseManager.saveData() method on the onDataChange() event but it didn’t work), along with the onDataChange event will never fired until we click outside.

That’s why, I tried to save the data on onFocus event.

Is there any Issue in saving the data in the onFocus event???

Thanks.

Hi infop,

The point which Johan makes is that of the timing of the event call of ‘saveData()’

If you have a saveData() triggered onFocus then the save will/may be run prior to actual data being altered.

It could be this timing glitch which gives you your unusual behaviour

Why not have a method run onAction of the field which toggles the value and then saves the data as a single process ?

Cheers
Harry