I would like to share a behavior of the onShow which is very critical in my opinion and may lead to serious errors (it did in our case).
Prerequisites:
Any given form with an onLoad method containing the stmt foundset.clearFoundSet();
The above form with an onShow method attached (containing of course some stmts
Result:
The onShow method is NOT triggered, because the foundset is empty! (The table actually contains records)
That means:
The onShow method is implicit conditionally executed - depending whether the foundset is empty or not!
If one uses the firstShow parameter, obviously the code in onShow is actually never executed.
Isn’t this VERY dangerous, as one does not think of event hooks being dependent on any condition like the above described?
I did not test the behavior on forms with no table associated.
Regards, Robert
PS: It seems that foundset.clearFoundSet() is superseded by foundset.clear(), although foundset.clearFoundSet() does not appear as deprecated in Servoy Developer
PS2: foundset.clear shows the same behavior as foundset.clearFoundSet()
Did you make a case for this? What was the result?
We are experiencing a problem that resembles yours.
Given a tbl-form and a dtl-form based on the same foundset we have a find-button that (when the tbl is shown) shows the dtl-form and puts this form in find modus. In this case the onShow-event of the dtl-form is not triggered.If however we put application.updateUI(1000) between showing the dtl-form and putting it in find modus (controller.find()) the onShow event is triggered!
problem with this is that show could be executed later (its really done when it is really shown and that happens only after your code ends),
and then find is effective, and in find we don’t execute script (only if there is a reference to controller.search or in 6 you have @allowinfind annotation in the doc of that method)
Your description sounds quite familiar to me.
I checked and I did not make a case (I seem to have forgotten that). I tried to reproduce it and the problem does not appear in a simple case, i. e. just a form based on a table. We don’t exactly remember here where it occured (unfortunatly), but we are quite sure it appeared in a module. And, with quite a big chance, some other relevant conditions in place.
For the moment I can’t add a reproducable example, sorry, but I hope Servoy can correct the behaviour with your help.
Best regards,
michel:
Robert,
Did you make a case for this? What was the result?
We are experiencing a problem that resembles yours.
Given a tbl-form and a dtl-form based on the same foundset we have a find-button that (when the tbl is shown) shows the dtl-form and puts this form in find modus. In this case the onShow-event of the dtl-form is not triggered.If however we put application.updateUI(1000) between showing the dtl-form and putting it in find modus (controller.find()) the onShow event is triggered!