Hi Folks, I’m still trying to get the Servoy concepts right in my head - as opposed to the ‘old way’
I have a small table (six records), with one column called sc_active. When set to true that row is read and placed in a global var for use through-out the solution. The table is displayed in record view on a form and there is a checkbox DP for the sc_active column.
When the user clicks on the checkbox to make a record the ‘active’ row I need to ensure this is the only row set to true.
Of course I could step through the records (there are only six) using controller and ensure all the other rows are set false, but there is so much hidden in Servoy I’m sensing there might be a better way to make that happen?
I would use the foundsetupdater to set the sc_active in ALL records to false BEFORE you actually set the value. Like in a onDataChange event.
Another way would be to use the onUpdate table event. This is a Pre-Update event where you could reset all the values before the actual update.
I would use the foundsetupdater to set the sc_active in ALL records to false BEFORE you actually set the value. Like in a onDataChange event.
Another way would be to use the onUpdate table event. This is a Pre-Update event where you could reset all the values before the actual update.
Just some ideas.
Thanks Robert - the onDataChange is where I would have headed - just thought there might have been a more elegant method (not that that’s not a good 'un) but I’m constantly blown away with how simple Servoy can make some things!