Orgitem"

From Documentation
Line 17: Line 17:
 
<source language="xml">
 
<source language="xml">
  
 +
</source>
 +
 +
=Label and Image=
 +
 +
Orgitem provides <javadoc method="setImage(java.lang.String)">org.zkoss.zkmax.zul.Orgitem</javadoc> and <javadoc method="setLabel(java.lang.String)">org.zkoss.zkmax.zul.Orgitem</javadoc> to simplify the assignment of image and label to a Orgitem. However, they are actually placed in the node (of the child Orgnode). Furthermore, if the Orgnode is not created, they will be created automatically. For example,
 +
 +
<source lang="xml">
 +
<orgitem label="Hello"/>
 +
</source>
 +
 +
is equivalent to
 +
 +
<source lang="xml">
 +
<orgitem>
 +
<orgnode label="Hello"/>
 +
</orgitem>
 +
</source>
 +
 +
It also means you cannot attach a Orgnode child to the Orgitem, after setImage or setLabel was invoked. It means, though a bit subtle, the following will cause an exception:
 +
 +
<source lang="xml">
 +
<orgitem label="Hello"> <!-- Orgnode is created automatically because of setLabel -->
 +
<orgnode/> <!-- exception since only one Orgnode is allowed per Orgitem -->
 +
</orgitem>
 
</source>
 
</source>
  

Revision as of 07:26, 8 August 2018

Orgitem

Employment/Purpose

Orgitem contains a node (Orgnode), and an optional Orgchildren.

If the component doesn't contain a Orgchildren, it is a leaf node that doesn't accept any child items.

If it contains a Orgchildren, it is a branch node that might contain other items.

For a branch node, an +/- button will appear at the beginning of the node, such that user could open and close the item by clicking on the +/- button.

Example

Label and Image

Orgitem provides Orgitem.setImage(String) and Orgitem.setLabel(String) to simplify the assignment of image and label to a Orgitem. However, they are actually placed in the node (of the child Orgnode). Furthermore, if the Orgnode is not created, they will be created automatically. For example,

	<orgitem label="Hello"/>

is equivalent to

	<orgitem>
		<orgnode label="Hello"/>
	</orgitem>

It also means you cannot attach a Orgnode child to the Orgitem, after setImage or setLabel was invoked. It means, though a bit subtle, the following will cause an exception:

	<orgitem label="Hello"> <!-- Orgnode is created automatically because of setLabel -->
		<orgnode/> <!-- exception since only one Orgnode is allowed per Orgitem -->
	</orgitem>

Supported Events

Name
Event Type
onOpen
Event: OpenEvent

Denotes user has opened or closed a component. It is useful to implement load-on-demand by listening to the onOpen event, and creating components when the first time the component is opened.

Supported Children

* Orgnode,  Orgchildren

Version History

Last Update : 2018/08/08


Version Date Content
     



Last Update : 2018/08/08

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