Page 1 of 1

Modal dialog doesn't close on [OK]

Posted: Tue Apr 10, 2012 8:02 am
by Bjarne
I have a modal dialog with an OK button on it which Action is set to 'Return from Dialog'.
When clicking on the button the dialog is expected to close immediately but it doesn't.

In fact it seems the dialog waits until the next dialog in the sequence is shown.
In my particular case I have some script that needs to be executed between the dialogs so it cannot be shown immediately.

The correct behaviour would be to close the modal dialog, and show the next dialog after a few seconds when the intermediate code has finished executing.

The result is frustrating customers which frenetically clicks on the button believing the installer has hanged.

I've tried to set the dialog Action to 'Go to Next Dialog' but it behaves the same..

Running IA 2012.

Re: Modal dialog doesn't close on [OK]

Posted: Tue Apr 10, 2012 8:26 am
by bokkie
Bjarne,

Have a look at the Hide Dialog statement. Does that help?

Re: Modal dialog doesn't close on [OK]

Posted: Tue Apr 10, 2012 9:50 am
by FrancescoT
That's correct Peter

Thank you.

Regards

Re: Modal dialog doesn't close on [OK]

Posted: Tue Apr 10, 2012 1:41 pm
by Bjarne
Ouch! That easy eh? Will give it a whack first thing tomorrow morning and let you know :mrgreen:

Re: Modal dialog doesn't close on [OK]

Posted: Tue Apr 10, 2012 11:26 pm
by Bjarne
Unfortunately this doesn't work. 'Hide Dialog' only hides non-modal dialogs and mine is a modal one (letting the user select an option before continuing).

Just for testing I inserted a messagebox after the dialog is expected to close, see attached image.
The image shows both the dialog and the messagebox. Note that the messagebox also shows the dialogresult (the pressed button in this case).
Surely the dialog must be considered out of scope and should have been closed when the messagebox is shown?
Modal Dialog
Modal Dialog
IA_ModalDialog.png (31.71 KiB) Viewed 6104 times

Re: Modal dialog doesn't close on [OK]

Posted: Wed Apr 11, 2012 9:45 am
by FrancescoT
Dear Bjarne,

why do you not use a similar behaviour in your script?

As example: After the welcome dialog, I used a progress dialog (non-Modal) that update the status for supposed actions. When completed I used a dialog box and then the script flow continues.
Label: Welcome Dialog
Display Dialog: welcome, wait for dialog to return (modal)
if Variable WIZARD Equals CANCEL
GoTo Label: Main Install
end

Comment: Display a progress dialog as non-Modal
Display Dialog: progress, use as progress dialog (non-modal)
Comment: Execute some action
MessageBox: Debug, Test
Hide Dialog
Of course you could use a customized progress dialog to proper display your actions.

Regards