Combobox"

From Documentation
Line 114: Line 114:
 
| July, 2010
 
| July, 2010
 
| Combobox supports <javadoc type="interface">org.zkoss.zul.ext.Selectable</javadoc> if it is implemented with the specified <javadoc type="interface">org.zkoss.zul.ListModel</javadoc>.
 
| Combobox supports <javadoc type="interface">org.zkoss.zul.ext.Selectable</javadoc> if it is implemented with the specified <javadoc type="interface">org.zkoss.zul.ListModel</javadoc>.
 +
|-
 +
| 5.0.4
 +
| July 2010
 +
| Support onAfterRender event
 
|}
 
|}
  
 
{{ZKComponentReferencePageFooter}}
 
{{ZKComponentReferencePageFooter}}

Revision as of 11:23, 9 August 2010

Combobox

Employment/Purpose

Components: combobox and comboitem.

A combobox is a special text box that embeds a drop-down list. With comboboxes, users are allowed to select from a drop-down list, in addition to entering the text manually.

Example

ZKComRef Combobox Example.PNG

 <combobox>
     <comboitem label="Simple and Rich"/>
     <comboitem label="Cool!"/>
     <comboitem label="Ajax and RIA"/>
 </combobox>



Supported events

Name
Event Type
onChange
Event: InputEvent

Denotes the content of an input component has been modified by the user.


onChanging
Event: InputEvent

Denotes that user is changing the content of an input component. Notice that the component's content (at the server) won't be changed until onChange is received.

Thus, you have to invoke the getValue method in the InputEvent class to retrieve the temporary value.

onSelect
Event: SelectEvent

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

onSelection
Event: SelectionEvent

Denotes that user is selecting a portion of the text of an input component. You can retrieve the start and end position of the selected text by use of the getStart and getEnd methods.

onOpen
Event: OpenEvent

Denotes user has opened or closed a component. Note: unlike onClose, this event is only a notification. The client sends this event after opening or closing the 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.


onFocus
Event: Event

Denotes when a component gets the focus.

onBlur
Event: Event

Denotes when a component loses the focus.

onCreate
Event: CreateEvent

It's used to make the combobox do some action after it has been created. For example you can make it 'ReadOnly' ( onCreate="self.setReadonly(true);" ), 'Disabled' ( onCreate="self.setDisabled(true);" ) or even 'Select' a value from the combobox ( onCreate="self.setSelectedIndex(0);" ) .



Supported Children

Comboitem

Use cases

Version Description Example Location
     

Version History

Version Date Content
5.0.4 July, 2010 Combobox supports Selectable if it is implemented with the specified ListModel.
5.0.4 July 2010 Support onAfterRender event



Last Update : 2010/08/09

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