on form frmInputDialog there are two buttons named ok & cancel respectively (both button’s onAction method name is closeForm). The close window button is already disabled.
The variable btnName should get the name of the button clicked from the form shown in formInDialog.
But it gets blank.
btnName = application.getMethodTriggerElementName() before the showFormInDialog
The “ok” or “cancel” button is clicked inside formInDialog. But
btnName = application.getMethodTriggerElementName() did received the correct button name (in the main form after the formInDialog is closed)
This behaviour was in the older versions but not anymore now.
yes i get that you didn’t do that.
But i was just explaining that it is very strange behaviour.
That suddenly the trigger things are changing inside a method . It should be always stable.. (which is still not the case but that is an other matter)
So before or after the showForm should the trigger methods return the same thing.. Because for that method you are in is triggered by a specific action and that should be always stable.. No matter what.
I will look at this later on. (so that before and after the showFormInDialog the same things will be returned)
Is the described way of getting the answer of which was the pressed button in a form dialog (called with showFormInDialog) in this thread the standard way of doing it?
Thanks for your reply. I just thought, because it’s the special command showFormInDialog, one would expect the calling form to get the result of the dialog (form) button pressed, because that’s what a dialog form is for, isn’t it? Or am I missing something here?
BTW, the debugger still behaves very strange as desrcibed earlier in this thread, one has to stop at the calling command, otherwise the behaviour is very strange.
Best regards, Robert
jcompagner:
set it in a global or javascript variable for later reading.
That form in dialog is not something like the dialogs plugin.
Because what it does is up to the developer and you have to implement that.
Also opening a form in dialog and there going into the debugger again is really some thing tricky (underneath) because it is not one session again. There are suddenly 2 debug sessions.. Thats why it is a bit erratic.. Maybe we can see if this can be fixed a bit better but it is the way the javascript engine works.
My understanding is that code is executed “to the end” for the first formInDialog that you show, but not for further dialogs that yu might open from the first.
the first call to showFormInDialog will block the method execution at that point. Until the dialog is closed. (then it runs furter)
patrick is right that at the moment if you show a form in a form in dialog (so you stack it) then currently the method doesn’t block because we don’t really show a new dialog but reuse the old one.
I hope that i can give you an option for this in 3.0 so that we do show a second or third dialog and the method will block.
jcompagner:
That form in dialog is not something like the dialogs plugin.
Because what it does is up to the developer and you have to implement that.
I understand that it’s different from the dialog plugin, but as the name implies, I assume it is used primarily (or exclusivly?) for dialogs. And as that, it’s up to the developer to put anything on this dialog, but at the end there is always an answer needed, something like Cancel or Save | Export or whatever. So to me, it would be welcome to be able to read back the buttons pressed. Or do others see it differently?
jcompagner:
Also opening a form in dialog and there going into the debugger again is really some thing tricky (underneath) because it is not one session again. There are suddenly 2 debug sessions.. Thats why it is a bit erratic.. Maybe we can see if this can be fixed a bit better but it is the way the javascript engine works.
Because if you have enabled the debugger then the form in dialog is not shown as modal. Because you maybe want to debug a script that is executed in that dialog.
If this is not the case if you have a reproduceable test case where a method runs further when showing the first dialog. Please make a sample of this and send it over.