How to detect when the user closes an XUI dialog?

Answered by: Tung Fu (PTC) Last Updated: 2006-07-31

=Question=

How to detect when the user closes a XUI dialog?

=Tung Fu answers=

The WindowClosing listener can be added to a Window object or the Application object. For example, you can add a listener to the active window as follows:

Application.activeWindow.addEventListener("WindowClosing", listener, false);

Note that when the listener is added to a Window object, the third parameter of the addEventListener needs to be "false", because the Window object is the target of the WindowClosing event.

If the WindowClosing listener is added to the Application, the listener listens to all windows in Epic.