Developer reference The XUL Components Components Button

From Documentation

Jump to: navigation, search

Contents

Button

You could assign a label and an image to a button by the label and image properties. If both are specified, the dir property control which is displayed up front, and the orient property controls whether the layout is horizontal or vertical.

Image:button.jpg


 <button label="Left" image="/img/folder.gif" width="125px"/>
 <button label="Right" image="/img/folder.gif" dir="reverse" width="125px"/>
 <button label="Above" image="/img/folder.gif" orient="vertical" width="125px"/>
 <button label="Below" image="/img/folder.gif" orient="vertical" dir="reverse" width="125px"/>

Class Name

org.zkoss.zul.Button

Supported Child Components

*NONE

Supported Events

Name
Event Type
onClick
[#MouseEvent org.zkoss.zk.ui.event.MouseEvent]


Description: Denotes user has clicked the component.

onRightClick
[#MouseEvent org.zkoss.zk.ui.event.MouseEvent]


Description: Denotes user has right-clicked the component.

onDoubleClick
[#MouseEvent org.zkoss.zk.ui.event.MouseEvent]


Description: Denotes user has double-clicked the component.

onFocus
[#Event org.zkoss.zk.ui.event.Event]


Description: Denotes when a component gets the focus.

onBlur
[#Event org.zkoss.zk.ui.even.Event]


Description: Denotes when a component loses the focus.

Properties

Property
Description
Data Type
Default Value
dir
Sets the direction of button

Value:normal | reverse

java.lang.String
normal
disabled
Sets whether it is disabled or not
boolean
false
href
Provides a hyper link
java.lang.String
<empty string>
orient
Sets the orientation of button

Value:horizontal | vertical

java.lang.String
horizontal
target
Sets the target frame or window
java.lang.String
<null>
tabindex
Sets the tab order of this component
int
-1

Methods

Name
Description
Return Data Type
isChildable() Determines whether it accepts child components

Value: false

Note: No child is allowed.

boolean

Inherited From

Inherited From
[#LabelImageElement org.zkoss.zul.impl.LabelImageElement]
[#LabelElement org.zkoss.zul.impl.LabelElement]
[#XulElement org.zkoss.zul.impl.XulElement]
[#HtmlBasedComponent org.zkoss.zk.ui.HtmlBasedComponent]
[#AbstractComponent org.zkoss.zk.ui.AbstractComponent ]