Menupopup"

From Documentation
Line 3: Line 3:
 
= Menupopup =
 
= Menupopup =
  
*Demonstration: [http://www.zkoss.org/zkdemo/userguide/#t1 Menu]  
+
*Demonstration: [http://www.zkoss.org/zkdemo/menu Menu]  
 
*Java API: <javadoc>org.zkoss.zul.Menupopup</javadoc>
 
*Java API: <javadoc>org.zkoss.zul.Menupopup</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zul.menu.Menupopup</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zul.menu.Menupopup</javadoc>
 
+
*Style Guide: [http://books.zkoss.org/wiki/ZK_Style_Guide/XUL_Component_Specification/Menupopup Menupopup]
 
= Employment/Purpose =
 
= Employment/Purpose =
  
Line 52: Line 52:
 
</source>
 
</source>
  
=Supported events=
+
=Supported Events=
  
 
{| border="1" | width="100%"
 
{| border="1" | width="100%"
Line 58: Line 58:
 
! <center>Event Type</center>
 
! <center>Event Type</center>
 
|-
 
|-
| <center><tt>onOpen</tt></center>
+
| None
| <javadoc>org.zkoss.zk.ui.event.OpenEvent</javadoc>
+
| None
 
 
<tt>'''Description:''' </tt> Denotes user has opened or closed a component.
 
 
|}
 
|}
 +
*Inherited Supported Events: [[ZK_Component_Reference/Essential_Components/Popup#Supported_Events | Popup]]
  
 
=Supported Children=
 
=Supported Children=
Line 68: Line 67:
 
  *[[ZK_Component_Reference/Essential_Components/Menu | Menu ]], [[ZK_Component_Reference/Essential_Components/Menu/Menuitem | Menuitem ]], [[ZK_Component_Reference/Essential_Components/Menu/Menuseparator | Menuseparator]]
 
  *[[ZK_Component_Reference/Essential_Components/Menu | Menu ]], [[ZK_Component_Reference/Essential_Components/Menu/Menuitem | Menuitem ]], [[ZK_Component_Reference/Essential_Components/Menu/Menuseparator | Menuseparator]]
  
=Use cases=
+
=Use Cases=
  
[[ZK_Component_Reference/Essential_Components/Menu#Use_cases | Menu]]
+
{| border='1px' | width="100%"
 +
! Version !! Description !! Example Location
 +
|-
 +
| &nbsp;
 +
| &nbsp;
 +
| &nbsp;
 +
|}
  
 
=Version History=
 
=Version History=

Revision as of 04:36, 16 November 2010

Menupopup

Employment/Purpose

A container used to display menus. It should be placed inside a Menu.

Supported event: onOpen.

Note: to have better performance, onOpen is sent only if non-deferrable event listener is registered (see Deferrable).

To load the content dynamically, you can listen to the onOpen event, and then create menuitem when OpenEvent.isOpen() is true.

Default HtmlBasedComponent.getSclass(): menupopup.


Example

ZKComRef Menubar.png


<menubar id="menubar">
	<menu label="File">
		<menupopup onOpen="alert(self.id)">
			<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>
	<menu label="Help">
		<menupopup>
			<menuitem label="Index" onClick="alert(self.label)" />
			<menu label="About">
				<menupopup>
					<menuitem label="About ZK" onClick="alert(self.label)" />
					<menuitem label="About Potix" onClick="alert(self.label)" />
				</menupopup>
			</menu>
		</menupopup>
	</menu>
</menubar>

Supported Events

Name
Event Type
None None
  • Inherited Supported Events: Popup

Supported Children

* Menu ,  Menuitem ,  Menuseparator

Use Cases

Version Description Example Location
     

Version History

Version Date Content
     



Last Update : 2010/11/16

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.