Panel

Panel is a container that has specific functionality and structural components that make it the perfect building block for application-oriented user interfaces. The Panel contains bottom, top, and foot toolbars, along with separate header, footer and body sections. It also provides built-in collapsible, closable, maximizable, and minimizable behavior, along with a variety of pre-built tool buttons that can be wired up to provide other customized behavior. Panels can be easily embedded into any kind of ZUL component that is allowed to have children or layout component. Panels also provide specific features like float and move. Unlike Window, Panels can only be floated and moved inside its parent node, which is not using zk.setVParent() function at client side. In other words, if Panel's parent node is an relative position, the floated panel is only inside its parent, not the whole page. The second difference of Window is that Panel is not an independent ID space (by implementing IdSpace), so the ID of each child can be used throughout the panel.

<panel height="100px" width="200px" style="margin-bottom:10px"
    title="Panel1" border="normal" maximizable="true"    
    collapsible="true">    
    <panelchildren>PanelContent1</panelchildren>    
</panel>
<panel height="100px" width="200px" framable="true" title="Panel2"
    border="normal" maximizable="true" style="margin-bottom:10px">    
    <panelchildren>PanelContent2</panelchildren>    
</panel>

Class Name

org.zkoss.zul.Panel

Supported Child Components

Panelchildren

Supported Events

Name

Event Type

onMove

Event: org.zkoss.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.

onMaximize

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

Denotes user has maximize a component.

onMinimize

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

Denotes user has minimize a component.

onClose

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

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

component shall detach itself.

Properties

Name

Description

Return Data Type

border

Sets the border

Values: none | normal

java.lang.String

closable

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

boolean

Collapsible

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

boolean

Floatable

Sets whether to float the panel to display it inline where it is rendered.

boolean

Framable

Sets whether to render the panel with custom rounded borders.

boolean

maximizable

Sets whether to display the maximizing button and allow the user to maximize the panel, when a panel is maximized, the button will automatically change to a restore button with the appropriate behavior already built-in that will restore the panel to its previous size.

boolean

maximized

Sets whether the panel is maximized, and then the size of the panel will depend on it to show a appropriate size.

boolean

minimized

Sets whether to display the minimizing button and allow the user to minimize the pane

boolean

minimizable

Sets whether the panel is minimized.

boolean

Movable

Sets whether to move the panel to display it inline where it is rendered.

boolean

open

Opens or closes this Panel.

boolean

title

Sets the title.

String

Visible

boolean

Methods

Name

Description

Return Data Type

addMoved(org.zkoss.zk.ui.Component oldparent, org.zkoss.zk.ui.Page oldpg, org.zkoss.zk.ui.Page newpg)

void

addToolbar(java.lang.String name, Toolbar toolbar)

Adds the toolbar of the panel by these names, "tbar", "bbar", and "fbar".

boolean

clone()

java.lang.Object

getBottomToolbar()

Returns the bottom toolbar of this panel.

org.zkoss.zul.Toolbar

getCaption()

Returns the caption of this panel.

org.zkoss.zul.Caption

getFootToolbar()

org.zkoss.zul.Toolbar

getMoldSclass()

String

getOuterAttrs()

String

getPanelchildren()

Returns the panelchildren of this panel.

org.zkoss.zul.Panelchildren

getRealSclass()

String

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

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

void

Inherited From