Window

A window is, like HTML DIV tag, used to group components. Unlike other components, a window has the following characteristics.

<hbox>
    <window title="Embedded Style" border="normal" width="200px">    
        Hello, Embedded!        
    </window>    
    <window title="Cyan Style" sclass="wndcyan" border="normal" width="200px">    
        Hello, Cyan!        
    </window>    
    <window title="Popup Style" sclass="popup" border="normal" width="200px">    
        Hello, Popup!        
    </window>    
    <window title="Modal Style" sclass="modal" border="normal" width="200px">    
        Hello, Modal!        
    </window>    
</hbox>

Class Name

org.zkoss.zul.Window

Supported Child Components

*ALL

Supported Events

Name

Event Type

onMove

Event: org.zkoss.ui.zk.ui.event.Event

Denotes the close button is pressed by a user, and the

component shall detach itself.

onOpen

Event: org.zkoss.zk.ui.event.OpenEvent

Denotes user has opened or closed a component.

Note:

Unlike onClose, this event is only a notification. The

client sends this event after opening or closing the

component.

It is useful to implement load-on-demand by listening to

the onOpen event, and creating components when the

first time the component is opened.

onClose

Event: org.zkoss.ui.zk.ui.event.Event

Denotes the close button is pressed by a user, and the

component shall detach itself.

onOK

Event: org.zkoss.zk.ui.event.KeyEvent

Denotes user has pressed the ENTER key.

onCacnel

Event: org.zkoss.zk.ui.event.KeyEvent

Denotes user has pressed the ESC key.

onCtrlKey

Event: org.zkoss.zk.ui.event.KeyEvent

Denotes user has pressed a special key, such as PgUp, Home and a key combined with the Ctrl or Alt key. Refer to the ctrlKeys Property section below for details.

Properties

Property

Description

Data Type

Default Value

border

Sets the border

Values: none | normal

java.lang.String

none

closable

Sets whether to show a close button on the title bar.

boolean

false

contentStyle

Sets the CSS style for the content block of the window.

java.lang.String

<empty string>

ctrlKeys

Sets what keystrokes to intercept.

java.lang.String

<null>

draggable

java.lang.String

<null>

mode

Sets the mode of window.

Values: overlapped | popup | modal | embedded | highlighted.

int

0

position

Sets how to position the window at the client screen.

java.lang.String

<null>

sizable

Sets whether the window is sizable.

boolean

false

title

Sets the title.

java.lang.String

<empty string>

visible

Changes the visibility of the window.

boolean

false

Methods

Name

Description

Return Data Type

clone()

java.lang.Object

doEmbedded()

Makes this window as embeded with other components

void

doHighlighted()

Makes this window as highlited.

void

doModal()

Makes this window as a modal dialog.

void

doOverlapped()

Makes this window as overlapped with other components.

void

doPopup()

Makes this window as popup, which is overlapped with other

component and auto-hiden when user clicks outside of the window.

void

getContentSclass()

Returns the style class used for the content block.

java.lang.String

getOuterAttrs()

java.lang.String

getTitleSclass()

Returns the style class used for the title.

java.lang.String

inEmbedded()

Returns whether this is embedded with other components

boolean

inHighlighted()

Returns whether this is a highlighted window.

boolean

inModal()

Returns whether this is a modal dialog.

boolean

inOverlapped()

Returns whether this is a overlapped window.

boolean

inPopup()

Returns whether this is a popup window.

boolean

insertBefore(org.zkoss.zk.ui.Component child,

org.zkoss.zk.ui.Component insertBefore)

boolean

onChildRemoved(org.zkoss.zk.ui.Component child)

void

onClose()

Process the onClose event sent when the close button is

pressed.

void

onModal()

Process the onModal event by making itself a modal window.

void

setPage(org.zkoss.zk.ui.Page page)

void

setParent(org.zkoss.zk.ui.Component parent)

void

Inherited From