Not sure this is bus so I’m posting it here. I got two forms based on the same table. On form A there is a tabpanel that displays form B. So far so good.
Now, if i’m on form B and do some record manipulation (show omited, show all, etc) the onRecordSelection method of form A is executed.
It’s not bothering me since I actually don’t use form B directly but wanted to know if it’s normal behavior.
Just noticed similar behavior in this situation:
form A (record view) and form B (list view) based on same table, form A has a onRecordSelection method assigned but form B does not.
If you select a record on form B, having loaded form A first, the onRecordSelection of form A is executed.
foundsets are shared over forms (or you have set yourself a relatedfoundset in the form or you have set the property useSeperateFoundset)
and if you have loaded form A and then go to form B both based on the same table. Then they have the same foundset. So if you are changing the selected foundset in B then A will also change. We have to execute onRecordSelection then for A because if you do something like testing data and on that data you color or set the visibility of elements. Then you expect that when you go again to form A that form A has the right visual state for the selected record!
Thanks guys, this clarifies things; I have some code editing to do
A couple of notes:
1- Maarten’s comment should be included in Servoy’s help under the onRecordSelection definition as a note.
onRecordSelection is triggered on table level (not on form level).
I’d like it more if it would be on a form level.
2- Is there a way to just load a form without showing it? if not, Servoy could use a controller.load() to make form’s onRecordSelection method available to other forms.
It would be nice if we could specify that the onRecordSelection even run for just this form (i.e. not cascade) as part of the property - rather than having to add code to EVERY SINGLE onRecordSelection method.