Checkbox

A checkbox.

<window title="Checkbox demo" border="normal" width="350px">
        <checkbox id="apple" label="Apple" onCheck="doChecked()" />        
        <checkbox id="orange" label="Orange" onCheck="doChecked()" />        
        <checkbox id="banana" label="Banana" onCheck="doChecked()" />        
        <hbox>You have selected :<label id="fruit2"/></hbox>        
        <zscript>        
            void doChecked() {            
                fruit2.value = (apple.isChecked() ? apple.label+' ' : &quot;&quot;)                 
                    + (orange.isChecked() ? orange.label+' ' : &quot;&quot;)                     
                    + (banana.isChecked() ? banana.label+' ' : &quot;&quot;);                    
            }            
        </zscript>        
</window>

Class Name

org.zkoss.zul.Button

Supported Child Components

*ALL

Supported Events

Name

Event Type

onRightClick

org.zkoss.zk.ui.event.MouseEvent

Description: Denotes user has right-clicked the component.

onDoubleClick

org.zkoss.zk.ui.event.MouseEvent

Description: Denotes user has double-clicked the component.

onFocus

org.zkoss.zk.ui.event.Event

Description: Denotes when a component gets the focus.

onBlur

org.zkoss.zk.ui.even.Event

Description: Denotes when a component loses the focus.

onCheck

org.zkoss.zk.ui.event.CheckEvent

Description: Denotes when a component loses the focus.

Properties

Property

Description

Data Type

Default Value

checked

Sets whether it is checked.

boo lean

false

dis abled

Sets whether it is disabled.

boolean

false

name

Sets the name of this component.

java.lang.String

<null>

tabindex

Sets the tab order of this component.

int

-1

Methods

Name

Description

Return Data Type

getInnerAttrs()

Appends interior attributes for generating the HTML checkbox tag (the name, disabled and other attribute).

java.lang.String

getLabelAttrs()

Returns the attributes used by the embedded HTML LABEL tag.

java.lang.String

getOuterAttrs()

Appends exterior attributes for generating the HTML span tag (the event relevant attribute).

java.lang.String

Inherited From