|
||||||||||
| 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.Selectbox
public class Selectbox
A light weight dropdown list.
Default getZclass(): z-selectbox. It does not create child widgets for
each data, so the memory usage is much lower at the server. However, the
implementation is based on HTML SELECT and OPTION tags, so the functionality
is not as rich as Listbox.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
org.zkoss.zk.ui.AbstractComponent.Children |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
_zclass |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl |
|---|
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE |
| Constructor Summary | |
|---|---|
Selectbox()
|
|
| Method Summary | ||
|---|---|---|
Object |
clone()
|
|
|
getItemRenderer()
Returns the renderer to render each item, or null if the default renderer is used. |
|
|
getModel()
Returns the model associated with this selectbox, or null if this selectbox is not associated with any list data model. |
|
String |
getName()
Returns the name of this component. |
|
|
getRealRenderer()
|
|
int |
getSelectedIndex()
Returns the index of the selected item (-1 if no one is selected). |
|
int |
getTabindex()
Returns the tab order of this component. |
|
String |
getZclass()
|
|
void |
invalidate()
|
|
protected boolean |
isChildable()
|
|
boolean |
isDisabled()
Returns whether it is disabled. |
|
void |
onInitRender()
|
|
void |
onInitRenderNow()
|
|
void |
onPageAttached(org.zkoss.zk.ui.Page newpage,
org.zkoss.zk.ui.Page oldpage)
|
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
|
|
void |
service(org.zkoss.zk.au.AuRequest request,
boolean everError)
|
|
void |
sessionDidActivate(org.zkoss.zk.ui.Page page)
|
|
void |
sessionWillPassivate(org.zkoss.zk.ui.Page page)
|
|
void |
setDisabled(boolean disabled)
Sets whether it is disabled. |
|
void |
setItemRenderer(ItemRenderer<?> renderer)
Sets the renderer which is used to render each item if getModel()
is not null. |
|
void |
setItemRenderer(String clsnm)
Sets the renderer by use of a class name. |
|
void |
setModel(ListModel<?> model)
Sets the list model associated with this selectbox. |
|
void |
setName(String name)
Sets the name of this component. |
|
void |
setParent(org.zkoss.zk.ui.Component parent)
|
|
void |
setSelectedIndex(int jsel)
Selects the item with the given index. |
|
void |
setTabindex(int tabindex)
Sets the tab order of this component. |
|
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly |
| Methods inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Selectbox()
| Method Detail |
|---|
public String getZclass()
getZclass in class org.zkoss.zk.ui.HtmlBasedComponentpublic int getSelectedIndex()
public void setSelectedIndex(int jsel)
public int getTabindex()
Default: 0 (means the same as browser's default).
public void setTabindex(int tabindex)
throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueExceptionpublic <T> ItemRenderer<T> getItemRenderer()
public void setItemRenderer(ItemRenderer<?> renderer)
getModel()
is not null.
Note: changing a render will not cause the selectbox to re-render. If you
want it to re-render, you could assign the same model again (i.e.,
setModel(null) and than setModel(oldModel)), or fire an ListDataEvent event.
renderer - the renderer, or null to use the default.
org.zkoss.zk.ui.UiException - if failed to initialize with the model
public void setItemRenderer(String clsnm)
throws ClassNotFoundException,
NoSuchMethodException,
IllegalAccessException,
InstantiationException,
InvocationTargetException
ClassNotFoundException
NoSuchMethodException
IllegalAccessException
InstantiationException
InvocationTargetExceptionpublic boolean isDisabled()
Default: false.
protected boolean isChildable()
isChildable in class org.zkoss.zk.ui.AbstractComponentpublic void setDisabled(boolean disabled)
public String getName()
Default: null.
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
Don't use this method if your application is purely based on ZK's event-driven model.
public void setName(String name)
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
Don't use this method if your application is purely based on ZK's event-driven model.
name - the name of this component.public void setModel(ListModel<?> model)
model - the list model to associate, or null to dissociate any
previous model.
org.zkoss.zk.ui.UiException - if failed to initialize with the modelpublic void onInitRender()
public void onInitRenderNow()
public <T> ListModel<T> getModel()
public <T> ItemRenderer<T> getRealRenderer()
public void invalidate()
invalidate in interface org.zkoss.zk.ui.Componentinvalidate in class org.zkoss.zk.ui.AbstractComponentpublic void setParent(org.zkoss.zk.ui.Component parent)
setParent in interface org.zkoss.zk.ui.ComponentsetParent in class org.zkoss.zk.ui.AbstractComponent
public void onPageAttached(org.zkoss.zk.ui.Page newpage,
org.zkoss.zk.ui.Page oldpage)
onPageAttached in interface org.zkoss.zk.ui.sys.ComponentCtrlonPageAttached in class org.zkoss.zk.ui.AbstractComponent
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
throws IOException
renderProperties in class org.zkoss.zk.ui.HtmlBasedComponentIOException
public void service(org.zkoss.zk.au.AuRequest request,
boolean everError)
service in interface org.zkoss.zk.ui.sys.ComponentCtrlservice in class org.zkoss.zk.ui.HtmlBasedComponentpublic Object clone()
clone in interface org.zkoss.zk.ui.Componentclone in class org.zkoss.zk.ui.HtmlBasedComponentpublic void sessionWillPassivate(org.zkoss.zk.ui.Page page)
sessionWillPassivate in interface org.zkoss.zk.ui.sys.ComponentCtrlsessionWillPassivate in class org.zkoss.zk.ui.AbstractComponentpublic void sessionDidActivate(org.zkoss.zk.ui.Page page)
sessionDidActivate in interface org.zkoss.zk.ui.sys.ComponentCtrlsessionDidActivate in class org.zkoss.zk.ui.AbstractComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||