We make a thorough use of formInDialog in our solutions, but we only implement nested (multiple level) formInDialog recently. The manual state that the method which calls formInDialog is halted until dialog is closed.
This assertion is true only for first level call of the function, as a matter of fact, if you call a formInDialog from a method inside a dialog, the method is not halted by calling formInDialog.
Please confirm us either if it is a bug or a ‘feature’ as we ought to know it before coding these parts of our solutions. We can manage either comportement, but need to know ASAP if it will be corrected or not.
Example(pseudo-code): Form A calls dialog B, In B, a button call dialog C
The conclusion of HJK is correct and as far as I know Servoy won’t be able to solve this on short notice.
What you should do is bring the code that you run AFTER opening the 2nd dialog to that 2nd dialog and run it there after completing what needs to be done…
IT2BE:
The conclusion of HJK is correct and as far as I know Servoy won’t be able to solve this on short notice.
Thank you Marcel, I will go ahead with our projects, taking this as a ‘feature’ - code execution is blocked when calling FIRST level formInDialog- have a nice day.
one more thing: as far as I understood this, the code that comes last has to be executed from the second form that is shown. This is not really possible/wanted in my case, because the second dialog is used in many occasions. If the code I put here does not work, I will need to pass the name of that method to the second dialog, which I think is pretty ugly.
Could anyone clarify on how that is supposed to work? I don’t want to implement rather stupid workarounds for something that might be fixed in the next build…
patrick.. As it is said in this thread..
The second form dialog you show is NOT blocking.. So the code will be directly exectued when you show a dialog in a dialog..
So yes youre globals.var is never filled in when executing that code if you do call it from a dialog already.
If I understand right, I set the global to null, show a dialog to fill the global, but I run directly to the end of the originating method?
So do you have an idea of how one can implement an independent selection dialog (a form that presents records, you click on one, the ID is put somewhere)?
If I understand right, I set the global to null, show a dialog to fill the global, but I run directly to the end of the originating method?
Yes but only if you show a dialog in a dialog then this is the case. Not when main->dialog.
So if you independent selection dialog is shown as the second dialog then you have call back from the onHide of that form you show in youre selection dialog. There is currently no other way.
We will see if we can make an option to create another formdialog everythime you want to show one more in a dialog (so that all other form dialogs are staying where they are)
// show the second dialog and save the method to a global
globals.method = aMethod
forms.dialog.showDialog()
and then attach to the button that closes the second dialog (or onHide)
eval(globals.method)
That’s what I do now. It’s not a real beauty, is it?
We will see if we can make an option to create another formdialog everythime you want to show one more in a dialog (so that all other form dialogs are staying where they are)
As far as I understand that also means that the first dialog stays visible? That is a much requested feature anyway, I think that would be very useful!