|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.impl.InputElement
org.zkoss.zul.Textbox
org.zkoss.zul.Combobox
public class Combobox
A combo box.
Non-XUL extension. It is used to replace XUL menulist. This class
is more flexible than menulist, such as setAutocomplete(boolean)
setAutodrop(boolean).
Default HtmlBasedComponent.getSclass(): combobox.
Events: onOpen
Developers can listen to the onOpen event and initializes it
when OpenEvent.isOpen() is true, and/or
clean up if false.
Note: to have better performance, onOpen is sent only if
a non-deferrable event listener is registered
(see Deferrable).
Comboitem,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
Combobox.ExtraCtrl
A utility class to implement AbstractComponent.getExtraCtrl(). |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
Combobox()
|
|
Combobox(java.lang.String value)
|
|
| Method Summary | |
|---|---|
Comboitem |
appendItem(java.lang.String label)
Appends an item. |
java.lang.String |
getImage()
Returns the URI of the button image. |
java.lang.String |
getInnerAttrs()
Generates the Client-Side-Action attributes to the interior tag. |
Comboitem |
getItemAtIndex(int index)
Returns the item at the specified index. |
int |
getItemCount()
Returns the number of items. |
java.util.List |
getItems()
Returns a 'live' list of all Comboitem. |
java.lang.String |
getOuterAttrs()
|
protected int |
getRealStyleFlags()
Returns RS_NO_WIDTH|RS_NO_HEIGHT. |
Comboitem |
getSelectedItem()
Returns the selected item, or null if no matched. |
boolean |
insertBefore(org.zkoss.zk.ui.Component newChild,
org.zkoss.zk.ui.Component refChild)
|
boolean |
isAutocomplete()
Returns whether to automatically complete this text box by matching the nearest item ( Comboitem. |
boolean |
isAutodrop()
Returns whether to automatically drop the list if users is changing this text box. |
boolean |
isButtonVisible()
Returns whether the button (on the right of the textbox) is visible. |
boolean |
isChildable()
Childable. |
protected java.lang.Object |
newExtraCtrl()
|
void |
onChildAdded(org.zkoss.zk.ui.Component child)
|
void |
onChildRemoved(org.zkoss.zk.ui.Component child)
|
Comboitem |
removeItemAt(int index)
Removes the child item in the list box at the given index. |
void |
setAutocomplete(boolean autocomplete)
Sets whether to automatically complete this text box by matching the nearest item ( Comboitem. |
void |
setAutodrop(boolean autodrop)
Sets whether to automatically drop the list if users is changing this text box. |
void |
setButtonVisible(boolean visible)
Sets whether the button (on the right of the textbox) is visible. |
void |
setImage(java.lang.String img)
Sets the URI of the button image. |
void |
setMultiline(boolean multiline)
Sets whether it is multiline. |
void |
setRows(int rows)
Sets the rows. |
| Methods inherited from class org.zkoss.zul.Textbox |
|---|
coerceFromString, coerceToString, getRows, getType, getValue, isMultiline, setType, setValue |
| Methods inherited from class org.zkoss.zul.impl.InputElement |
|---|
checkUserError, clearErrorMessage, getAreaText, getCols, getConstraint, getErrorMessage, getMaxlength, getName, getRawText, getRawValue, getTabindex, getTargetValue, getText, isAsapRequired, isDisabled, isReadonly, isValid, onWrongValue, select, setCols, setConstraint, setConstraint, setDisabled, setMaxlength, setName, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText, showCustomError, validate |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getAllOnClickAttrs, getContext, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex |
| Methods inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, invalidate, isListenerAvailable, isVisible, onDrawNewChild, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Combobox()
public Combobox(java.lang.String value)
throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException| Method Detail |
|---|
public boolean isAutodrop()
Default: false.
public void setAutodrop(boolean autodrop)
public boolean isAutocomplete()
Comboitem.
Default: false.
If true, the nearest item will be searched and the text box is updated automatically. If false, user has to click the item or use the DOWN or UP keys to select it back.
Note: this feature is reserved and not yet implemented. Don't confuse it with the auto-completion feature mentioned by other framework. Such kind of auto-completion is supported well by listening to the onChanging event.
public void setAutocomplete(boolean autocomplete)
Comboitem.
public boolean isButtonVisible()
Default: true.
public void setButtonVisible(boolean visible)
public java.lang.String getImage()
public void setImage(java.lang.String img)
img - the URI of the button image. If null or empty, the default
URI is used.public java.util.List getItems()
Comboitem.
By live we mean you can add or remove them directly with
the List interface.
Currently, it is the same as AbstractComponent.getChildren(). However,
we might add other kind of children in the future.
public int getItemCount()
public Comboitem getItemAtIndex(int index)
public Comboitem appendItem(java.lang.String label)
public Comboitem removeItemAt(int index)
public Comboitem getSelectedItem()
By selected we mean the first Comboitem whose label
(LabelElement.getLabel()) equals with Textbox.getValue().
It is usually used with Comboitem.getValue().
The combobox may contain any value, so there may be no match at all.
Comboitem.getValue()public void setMultiline(boolean multiline)
Textbox
setMultiline in class Textboxpublic void setRows(int rows)
Textbox
setRows in class Textboxpublic java.lang.String getOuterAttrs()
getOuterAttrs in class Textboxpublic java.lang.String getInnerAttrs()
XulElement
getInnerAttrs in class Textboxprotected int getRealStyleFlags()
getRealStyleFlags in class org.zkoss.zk.ui.HtmlBasedComponent
public boolean insertBefore(org.zkoss.zk.ui.Component newChild,
org.zkoss.zk.ui.Component refChild)
insertBefore in interface org.zkoss.zk.ui.ComponentinsertBefore in class org.zkoss.zk.ui.AbstractComponentpublic boolean isChildable()
isChildable in interface org.zkoss.zk.ui.ComponentisChildable in class InputElementpublic void onChildAdded(org.zkoss.zk.ui.Component child)
onChildAdded in interface org.zkoss.zk.ui.ComponentonChildAdded in class org.zkoss.zk.ui.AbstractComponentpublic void onChildRemoved(org.zkoss.zk.ui.Component child)
onChildRemoved in interface org.zkoss.zk.ui.ComponentonChildRemoved in class org.zkoss.zk.ui.AbstractComponentprotected java.lang.Object newExtraCtrl()
newExtraCtrl in class InputElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||