My start up code sets some records on a particular form - which moves it to that record. It also has an inherited form which has an onRecordSelection attached to it - which sets some buttons and does an application.updateUI(). Obviously this pops the form open momentarily whilst the code does its thing.
I’d like to prevent this and I’d like the onRecordSelection() application.updatUI() to run only if the particular form is actually shown on screen at the time. I figured there would be a simple way to determine if the form is shown currently or not but I’m struggling to see it??
You can always get the context of a form using controller.getFormContext() and determine from this if the form is shown or not. Another way is to use a baseform that sets a form global on the onShow/onHide to log the state this form is in.
But I think the real question is why are you using application.updateUI() in this onRecordSelect ?
ROCLASI:
You can always get the context of a form using controller.getFormContext() and determine from this if the form is shown or not. Another way is to use a baseform that sets a form global on the onShow/onHide to log the state this form is in.
Excellent idea Robert - the global is a perfect route.
ROCLASI:
But I think the real question is why are you using application.updateUI() in this onRecordSelect ?
I’m using it in the inherited form to set nav buttons etc. Might not be state of the art but this works nicely in this environment.
Thanks for the feedback Bud - excellent as always.
if you have 2 forms, both on the same table, both showing the same foundset, both having a onRecordSelection
but 1 of them is not visible and the other is.
Then you will only get the onRecordSelection on the visible form. Servoy doesn’t fire ui events on none visible forms.
jcompagner:
if you have 2 forms, both on the same table, both showing the same foundset, both having a onRecordSelection
but 1 of them is not visible and the other is.
Then you will only get the onRecordSelection on the visible form. Servoy doesn’t fire ui events on none visible forms.
Thanks Johan - oddly that answered a question that came up for us this morning - and unrelated the the OP
Cheers