List and Tree Events"
Maya001122 (talk | contribs) m |
m (correct highlight (via JWB)) |
||
Line 17: | Line 17: | ||
| Event: <javadoc>org.zkoss.zk.ui.event.SelectEvent</javadoc> | | Event: <javadoc>org.zkoss.zk.ui.event.SelectEvent</javadoc> | ||
− | Denotes user has selected one or multiple child components. For a < | + | Denotes user has selected one or multiple child components. For a <code>listbox</code>, it is a set of <code>listitems</code>. For a tree, it is a set of <code>treeitems</code>. For a <code>tabbox</code>, it is a <code>tab</code>. |
− | Please note: < | + | Please note: <code>onSelect</code> is sent to both a <code>tab</code> and the <code>tabbox</code>. Therefore you can choose which component to add event listener to. |
|- | |- | ||
Line 32: | Line 32: | ||
| Event: <javadoc>org.zkoss.zk.ui.event.OpenEvent</javadoc> | | Event: <javadoc>org.zkoss.zk.ui.event.OpenEvent</javadoc> | ||
− | Denotes the user has opened or closed a component. Note: unlike < | + | Denotes the user has opened or closed a component. Note: unlike <code>onClose</code>, this event is only a notification. The client sends this event after opening or closing the component. It has a function named isOpen() allowing you to check whether it is open or closed. |
− | It is useful to implement ''load-on-demand'' by listening to the < | + | It is useful to implement ''load-on-demand'' by listening to the <code>onOpen</code> event, and creating components when the first time the component is opened. |
|- | |- | ||
Line 47: | Line 47: | ||
| Event: <javadoc>org.zkoss.zk.ui.event.OpenEvent</javadoc> | | Event: <javadoc>org.zkoss.zk.ui.event.OpenEvent</javadoc> | ||
− | There is no onClose event. There is only an onOpen event, however you can determine the state by using the < | + | There is no onClose event. There is only an onOpen event, however you can determine the state by using the <code>onOpen</code> function to check whether it is open or closed. |
|} | |} | ||
{{ ZKDevelopersGuidePageFooter}} | {{ ZKDevelopersGuidePageFooter}} |
Latest revision as of 10:45, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
List and Tree Events
onSelect | listbox
tabbox tab tree combobox |
Event: SelectEvent
Denotes user has selected one or multiple child components. For a Please note: |
onOpen | north
east west south groupbox treeitem combobox bandbox menupopup window |
Event: OpenEvent
Denotes the user has opened or closed a component. Note: unlike It is useful to implement load-on-demand by listening to the |
onClose | north
east west south groupbox treeitem combobox bandbox menupopup window |
Event: OpenEvent
There is no onClose event. There is only an onOpen event, however you can determine the state by using the |