A window.
Unlike other elements, each {@link Window} is an independent ID space(by implementing {@link org.zkoss.zk.ui.IdSpace}). It means a window and all its descendants forms a ID space and the ID of each of them is unique in this space. You could retrieve any of them in this space by calling {@link #getFellow}.
If a window X is a descendant of another window Y, X's descendants are not visible in Y's space. To retrieve a descendant, say Z, of X, you have to invoke Y.getFellow('X').getFellow('Z').
Events:
onMove, onOpen, onMaximize, onMinimize, and onClose.
Note: to have better performance, onOpen is sent only if a non-deferrable event listener is registered (see {@link org.zkoss.zk.ui.event.Deferrable}).
onMaximize
and onMinimize
are supported. (since 3.5.0)
onClose
is sent when the close button is pressed (if {@link #isClosable} is true). The window has to detach or hidethe window. By default, {@link #onClose} detaches the window. To preventit from detached, you have to call {@link org.zkoss.zk.ui.event.Event#stopPropagation}to prevent {@link #onClose} is called.
On the other hand, onOpen
is sent when a popup window (i.e., {@link #getMode} is popup) is closed due to user's activity(such as press ESC). This event is only a notification. In other words, the popup is hidden before the event is sent to the server. The application cannot prevent the window from being hidden.
Default {@link #getZclass}: z-window- {@link #getMode()}.(since 3.5.0)
@author tomyeh