Dialog close

I’m showing an edit form inside a dialog, the form has a save and cancel button to handle the correct data changes.
However i’m having a problem when the user clicks the close button of the dialog, is it possible to catch that event and handle it the same way as if the user clicked the cancel button?
The dialog is non-modal and that dialog uses other dialogs for messages.

See the onHide event on the Form.

Paul

I tried that, but onHide was also triggered when my formInDialog called another formInDialog

then shouldnt be the case i guess if you use named dialogs
what is your code that shows the second dialog?

Besides that you can hold some state like “myformvariable = 1”
which you test then again in the onhide that you know this is a “good” onhide (not a cancel)

My first dialog is called using:

	application.showFormInDialog('form_user',-1,-1,-1,-1,'i18n:svy.fr.lbl.user')

The second dialog is called from within a tabpanel of the first dialog:

application.showFormInDialog(forms.svy_sec_password_new)

thats the old way of doing it (you dont really get 2 dialogs) try this:

application.showFormInDialog(‘form_user’,-1,-1,-1,-1,‘i18n:svy.fr.lbl.user’, ‘myfirstdialog’)

application.showFormInDialog(forms.svy_sec_password_new,‘myseconddialog’)

Thanks Johan,
That works.