As far as I know there is currently no possibility to capture the closing box of a form in dialog. This means, all you have is the onHide method. Bu this method is also called (and should be), when a user hits a “save” button and you close the window via a method.
The way I do it is using a transaction. You start the transaction before you show the window. If the user hits “Save”, you commit the transaction. In your onHide method, you check if there is a transaction alive. If there is, you do whatever you want when someone closes a dialog.
The transaction is useful for one other purpose: It is the only way (I see) you allow a user a “Cancel”. Usually, all changes are written to the database. So all you can do is use globals and on a “Save” you compare global to field. This gave me hell in FileMaker (just like keeping a change log). In Servoy you can rollback a transaction and everything (including related records) will be forgotten immediatly. What a beauty, if you ask me.
This is what I use to prevent the user from clicking the close box during an entry process. I have this attached to the onHide property. Works fine for me!
if ( globals.TEEntryFlag == ‘true’ )
{
plugins.dialogs.showInfoDialog( ‘Close not allowed’, ‘You must either Accept or Reject the current entry’, ‘OK’)
return false;
}