For subforms I usually use an object in the container to inject data.
When the subform includes one listbox (or more), I include the entity selection for the listbox as a property of the object, along with other properties for the subform. I have it pretty standardized.
I’ve found out that «On bound variable change» event is only fired when the whole object variable changes, not if only one property of the object changes.
Is this a design limitation of the objects or can evolve in the future?
I usually asign the value using a pointer to the container, but I also tried it declaring the variable explicitly. Even loading the subform form after the container object is defined.
The main problem are the variables that are being modified inside the subform, like the current entity or current position of the listboxes.
My only workaround is this dirty, dirty trick in 3 steps when I need to update something.
// 1.- Retrieve the current value of the object $subformObject:=$pointerToContainer-> // 2.- Change just the desired property $subformObject.entitySelectionForListbox:=$entitySelection // 3.- Asign again the whole object just to activate the event $pointerToContainer->:=$subformObject
Do I need to use the old «Execute in subform»?
I will be really happy if someone tells me a beter strategy.
Thank you in advance: