Toolbarbutton

The behave of Toolbarbutton is similar to the button except the appearance is different. The button component uses HTML BUTTON tag, while thetoolbarbutton component uses HTML A tag.

A toolbarbutton could be placed outside a toolbar, However toolbarbuttons change their appearance if they are placed inside a toolbar.

Toolbarbutton supports getHref(). If getHref() is not null, the onClick handler is ignored and this element is degenerated to HTML's A tag.

See also : org.zkoss.zul.Button , org.zkoss.zul.Toolbar

<window title="toolbar demo" border="normal" width="300px">
    <caption>    
        <toolbarbutton label="button3" image="/img/folder.gif"/><space/>        
        <toolbarbutton label="button4" image="/img/folder.gif" dir="reverse" />        
    </caption>    
    <toolbar>    
        <toolbarbutton label="button1" image="/img/folder.gif" /><space/>        
        <toolbarbutton label="button2" image="/img/folder.gif" />        
    </toolbar>    
    <hbox>    
    <toolbarbutton label="button5" image="/img/folder.gif" orient="vertical"/><space/>    
    <toolbarbutton label="button6" image="/img/folder.gif" orient="vertical" dir="reverse"/>    
    </hbox>    
</window>

Class Name

org.zkoss.zul.Toolbarbutton

Supported Child Components

*NONE

Supported Events

Event Name

Event Type

onClick

org.zkoss.zk.ui.event.MouseEvent

Description:

Denotes user has clicked the component.

onRightClick

org.zkoss.zk.ui.event.MouseEvent

Description:

Denotes user has right-clicked the component.

Properties

Property

Description

Data Type

Default Value

dir

Sets the direction of image, if normal then text first, otherwise image first.

Check Button to know more.

Values : normal|reverse

String

normal

href

Sets the href, If null , the button has no function unless you specify the onClick handler. If has value, button will render as a HTML A tag.

String

<null>

ori ent

Sets the orient.

Check Button to know more.

Values : horizontal|vertical

String

horizontal

target

Sets the target frame or window, this attribute works when href not null

String

<null>

Methods

Name

Description

Data Type

Values

isChildable

Check Is this component allow children.

boolean

false

Inherited From