Menuitem

A single choice in a Menupopup element. It acts much like a button but it is rendered on a menu.

<menu label="File">
    <menupopup>    
        <menuitem label="New" onClick="alert(self.label)"/>        
        <menuitem label="Open" onClick="alert(self.label)"/>        
        <menuitem label="Save" onClick="alert(self.label)"/>        
        <menuseparator/>        
        <menuitem label="Exit" onClick="alert(self.label)"/>        
    </menupopup>    
</menu>

Class Name

org.zkoss.zul.Menuitem

Supported Child Components

*NONE

Supported Events

Event Name

Event Type

onClick

org.zkoss.zk.ui.event.MouseEvent

Description: A menu command is associated with a menu item. There are two ways to associate a command to it: the onClick event and the href property. If a event listener is added for a menu item for the onClick event, the listener is invoked when the item is clicked.

Properties

Property

Description

Data Type

Default Value

value

The value

String

<empty string>

href

The target frame or window.

String

<null>

Target

The href

String

<null>

autocheck

Whether the menuitem check mark will update each time the menu item is selected

Values: true | false

Boolean

false

checked

Whether it is checked.

Values: true | false

Boolean

false

Methods

Name

Description

Data Type

isTopmost()

Returns whether this is an top-level menu, i.e., not owning by another Menupopup.

Values: true | false

boolean

getOuterAttrs()

String

Inherited From