Modal Window

I have a modal window. I want to process code when the window closes. I wrongly expected the window.show() function to block until the window was closed. Looks like I need an event to fire to notify me when this occurs.

I can’t find the event listed in the documentation.

Recommendation?

This is how I solved it.

I overrode the window destroy method() and called a custom closeAction() function.

	destroy: function() {
		this.Super("destroy",arguments);
		if( this.closeAction )
			this.closeAction();
	}

Hi tgochenour.
There are some technical reasons why making the ‘show’ method blocking until the window is dismissed is not practical, so you’re correct that some kind of callback is required.

For Windows, we usually recommend overriding closeClick() for a Window. This is fired whenever the user closes the window via the top-right corner “X” button.

Alternatively, if you’re closing the window programatically from some other user interaction, such as a button inside the window, you may want to have the code that dismisses the window run your custom code after calling ‘window.hide()’.
If you want to fire your “callback” type code when the window is hidden and don’t know how it will be dismissed, it would also be appropriate to override the hide() method directly, being sure to call

this.Super("hide", arguments);

before running your custom logic.

Your solution of overriding destroy() may be appropriate too - it depends on whether in your usage your window is always destroyed after it is hidden. If you are planning to keep the window around and re-use it, clear() or hide() would be a more appropriate override point.

You may also be interested in the Dialog class. This is the class used for the standard isc.ask() and isc.warn() dialogs.

Regards
Isomorphic Software