Processing...
Description & Source Code

The Menu component features the checkbox function of Menuitem , enabling users to check menu items.

checkbox_menu.zul
<!-- Enable autocheck and checkmark to all menuitem-->
<?component name="menuitem" extends="menuitem" autocheck="true" checkmark="true" ?>
<zk>
	<hlayout spacing="20px">
	<div hflex="1">
		<div style="border: 1px solid #ccc;border-width: 0 1px;width:100%;">
			<menubar id="menubar">
				<menu label="View">
					<menupopup>
						<menuitem label="Ruler" checked="true" onCheck='lab1.setSelected(self.checked)' />
						<menuitem label="Compact Control" onCheck='lab2.setSelected(self.checked)' />
						<menuitem label="Toolbar" onCheck='lab3.setSelected(self.checked)' />
						<menuseparator />
						<menuitem label="Show system files(s)" onCheck='lab4.setSelected(self.checked)' />
						<menuitem label="Show hidden file(s)" checked="true" onCheck='lab5.setSelected(self.checked)' />
					</menupopup>
				</menu>
			</menubar>
		</div>
		<textbox width="100%" multiline="true" rows="9" value="Sample Text, Sample Text ,Sample Text ,Sample Text">
		</textbox>
	</div>
	<listbox hflex="1" multiple="true" nonselectableTags="*">
		<custom-attributes name="org.zkoss.zul.listbox.rightSelect">true</custom-attributes>
		<listhead>
			<listheader>Enabled View Feature</listheader>
		</listhead>
		<listitem id="lab1" selected="true">
			<listcell label="Ruler"></listcell>
		</listitem>
		<listitem id="lab2">
			<listcell label="Compact Control"></listcell>
		</listitem>
		<listitem id="lab3">
			<listcell label="Toolbar"></listcell>
		</listitem>
		<listitem id="lab4">
			<listcell label="Show system files(s)"></listcell>
		</listitem>
		<listitem id="lab5" selected="true">
			<listcell label="Show hidden file(s)"></listcell>
		</listitem>

	</listbox>
	</hlayout>
</zk>