Class Listitem
- All Implemented Interfaces:
Serializable,Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
- Direct Known Subclasses:
Listgroup,Listgroupfoot
Default getZclass(): z-listitem (since 5.0.0)
- Author:
- tomyeh
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA utility class to implementHtmlBasedComponent.getExtraCtrl().Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo -
Field Summary
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMoved(org.zkoss.zk.ui.Component oldparent, org.zkoss.zk.ui.Page oldpg, org.zkoss.zk.ui.Page newpg) voidbeforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component refChild) voidbeforeParentChanged(org.zkoss.zk.ui.Component parent) clone()getImage()Returns the image of theListcellit contains.intgetIndex()Returns the index of this item (a.k.a., the order in the listbox).getLabel()Returns the label of theListcellit contains, or null if no such cell.Returns the list box that it belongs to.Returns the listgroup that this item belongs to, or null.intReturns the maximal length of each item's label.getMold()org.zkoss.zk.ui.sys.PropertyAccessgetPropertyAccess(String prop) <T> TgetValue()Returns the value.booleanReturns whether it is disabled.booleanisLoaded()Returns whether the content of this item is loaded.booleanReturns whether it is selectable.booleanReturns whether it is selected.protected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) voidsetDisabled(boolean disabled) Sets whether it is disabled.voidDeprecated.as of release 6.0.0.voidSets the image of theListcellit contains.protected voidsetIndex(int index) voidSets the label of theListcellit contains.voidsetSelectable(boolean selectable) Sets whether it is selectable.voidsetSelected(boolean selected) Sets whether it is selected.<T> voidsetValue(T value) Sets the value.booleansetVisible(boolean visible) voidDeprecated.as of release 6.0.0.protected voidsmartUpdate(String name, boolean value) protected voidsmartUpdate(String name, int value) protected voidsmartUpdate(String name, Object value) Methods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setSkeleton, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getStubonlyDescendants, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setStubonlyDescendants, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Constructor Details
-
Listitem
public Listitem() -
Listitem
-
Listitem
-
-
Method Details
-
getListbox
Returns the list box that it belongs to.It is the same as
AbstractComponent.getParent(). -
getListgroup
Returns the listgroup that this item belongs to, or null.- Since:
- 3.5.0
-
getZclass
- Overrides:
getZclassin classorg.zkoss.zk.ui.HtmlBasedComponent
-
isSelectable
public boolean isSelectable()Returns whether it is selectable.Default: true.
- Since:
- 8.0.0
-
setSelectable
public void setSelectable(boolean selectable) Sets whether it is selectable.If the listbox is in a checkmark mode, the selectable state will affect the checkable icon to display or not.
Default: true.
- Parameters:
selectable-
-
getMaxlength
public int getMaxlength()Returns the maximal length of each item's label. It is a shortcut of getParent().getMaxlength(); Thus, it works only if the listbox's mold is "select". -
getValue
public <T> T getValue()Returns the value.Default: null.
Note: the value is application dependent, you can place whatever value you want.
If you are using listitem with HTML Form (and with the name attribute), it is better to specify a String-typed value.
-
setValue
public <T> void setValue(T value) Sets the value.- Parameters:
value- the value.Note: the value is application dependent, you can place whatever value you want.
If you are using listitem with HTML Form (and with the name attribute), it is better to specify a String-typed value.
-
isDisabled
public boolean isDisabled()Returns whether it is disabled.Default: false.
-
setDisabled
public void setDisabled(boolean disabled) Sets whether it is disabled. -
isSelected
public boolean isSelected()Returns whether it is selected.Default: false.
-
setSelected
public void setSelected(boolean selected) Sets whether it is selected. -
getLabel
Returns the label of theListcellit contains, or null if no such cell. -
setLabel
Sets the label of theListcellit contains.If it is not created, we automatically create it.
-
getImage
Returns the image of theListcellit contains. -
setImage
Sets the image of theListcellit contains.If it is not created, we automatically create it.
-
getIndex
public int getIndex()Returns the index of this item (a.k.a., the order in the listbox). -
isLoaded
public boolean isLoaded()Returns whether the content of this item is loaded. It is meaningful only ifgetListbox()is live data, i.e.,Listbox.getModel()is not null.- Since:
- 2.4.0
-
setIndex
protected void setIndex(int index) -
setVisible
public boolean setVisible(boolean visible) - Specified by:
setVisiblein interfaceorg.zkoss.zk.ui.Component- Overrides:
setVisiblein classorg.zkoss.zk.ui.AbstractComponent
-
smartUpdate
- Overrides:
smartUpdatein classorg.zkoss.zk.ui.AbstractComponent
-
smartUpdate
- Overrides:
smartUpdatein classorg.zkoss.zk.ui.AbstractComponent
-
smartUpdate
- Overrides:
smartUpdatein classorg.zkoss.zk.ui.AbstractComponent
-
getMold
- Specified by:
getMoldin interfaceorg.zkoss.zk.ui.Component- Overrides:
getMoldin classorg.zkoss.zk.ui.AbstractComponent
-
setWidth
Deprecated.as of release 6.0.0. To control the size of Listbox related components, please refer toListboxandListheaderinstead.- Overrides:
setWidthin classorg.zkoss.zk.ui.HtmlBasedComponent
-
setHflex
Deprecated.as of release 6.0.0. To control the size of Listbox related components, please refer toListboxandListheaderinstead.- Overrides:
setHflexin classorg.zkoss.zk.ui.HtmlBasedComponent
-
renderProperties
- Overrides:
renderPropertiesin classXulElement- Throws:
IOException
-
addMoved
protected void addMoved(org.zkoss.zk.ui.Component oldparent, org.zkoss.zk.ui.Page oldpg, org.zkoss.zk.ui.Page newpg) - Overrides:
addMovedin classorg.zkoss.zk.ui.AbstractComponent
-
getPropertyAccess
- Specified by:
getPropertyAccessin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
getPropertyAccessin classXulElement
-
beforeParentChanged
public void beforeParentChanged(org.zkoss.zk.ui.Component parent) - Specified by:
beforeParentChangedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
beforeParentChangedin classorg.zkoss.zk.ui.AbstractComponent
-
beforeChildAdded
public void beforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component refChild) - Specified by:
beforeChildAddedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
beforeChildAddedin classorg.zkoss.zk.ui.AbstractComponent
-
clone
- Specified by:
clonein interfaceorg.zkoss.zk.ui.Component- Overrides:
clonein classXulElement
-
getExtraCtrl
- Specified by:
getExtraCtrlin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
getExtraCtrlin classorg.zkoss.zk.ui.HtmlBasedComponent
-