SelectEvent"

From Documentation
Line 36: Line 36:
 
</zk>
 
</zk>
 
</source>
 
</source>
 +
 +
== Get the Previous Selected Items ==
 +
If user want to know which of the selected items are new added or removed, they can use the ''getPreviousSelectedItems'' method to filter out.
  
 
=Supported events=
 
=Supported events=
Line 66: Line 69:
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-
| &nbsp;
+
| 7.0.0
| &nbsp;
+
| October, 2013.
| &nbsp;
+
| [http://tracker.zkoss.org/browse/ZK-1992 Multiple selection component(listbox, chosenbox) support extra information for find out added item/removed item]
 
|}
 
|}
  
 
{{ZKComponentReferencePageFooter}}
 
{{ZKComponentReferencePageFooter}}

Revision as of 07:14, 31 October 2013

SelectEvent

  • Demonstration: N/A
  • Java API: SelectEvent
  • JavaScript API: N/A

Employment/Purpose

Represents an event cause by user's the list selection is changed at the client.


Example

Get Keys

It would be very helpful to add the getKeys() method of a MouseEvent to SelectEvents. For example, if you're using a listbox and want to detect if the CTRL key is being held when one of the listitems is selected.

ZKComRef SelectEvent GetKeys.png

<zk>
	<label id="i"/>
	<listbox onSelect='i.value = "keys: "+event.getKeys()'>
		<listhead>
			<listheader label="Population"/>
			<listheader label="%"/>
		</listhead>
		<listitem value="A">
			<listcell>a</listcell>
			<listcell label="20%"/>
		</listitem>
		<listitem value="B">
			<listcell>b</listcell>
			<listcell>c</listcell>
		</listitem>
	</listbox>
</zk>

Get the Previous Selected Items

If user want to know which of the selected items are new added or removed, they can use the getPreviousSelectedItems method to filter out.

Supported events

Name
Event Type
None None

Supported Children

*NONE

Use cases

Version Description Example Location
     

Version History

Version Date Content
7.0.0 October, 2013. Multiple selection component(listbox, chosenbox) support extra information for find out added item/removed item



Last Update : 2013/10/31

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