public class Listitem extends XulElement
Default getZclass()
: z-listitem (since 5.0.0)
Modifier and Type | Class and Description |
---|---|
protected class |
Listitem.ExtraCtrl
A utility class to implement
HtmlBasedComponent.getExtraCtrl() . |
Constructor and Description |
---|
Listitem() |
Listitem(String label) |
Listitem(String label,
T value) |
Modifier and Type | Method and Description |
---|---|
protected void |
addMoved(org.zkoss.zk.ui.Component oldparent,
org.zkoss.zk.ui.Page oldpg,
org.zkoss.zk.ui.Page newpg) |
void |
beforeChildAdded(org.zkoss.zk.ui.Component child,
org.zkoss.zk.ui.Component refChild) |
void |
beforeParentChanged(org.zkoss.zk.ui.Component parent) |
Object |
clone() |
Object |
getExtraCtrl() |
String |
getImage()
Returns the image of the
Listcell it contains. |
int |
getIndex()
Returns the index of this item (a.k.a., the order in the listbox).
|
String |
getLabel()
Returns the label of the
Listcell it contains, or null
if no such cell. |
Listbox |
getListbox()
Returns the list box that it belongs to.
|
Listgroup |
getListgroup()
Returns the listgroup that this item belongs to, or null.
|
int |
getMaxlength()
Returns the maximal length of each item's label.
|
String |
getMold() |
String |
getSrc()
Deprecated.
As of release 3.5.0, it is redundant since it
is the same
getImage() . |
<T> T |
getValue()
Returns the value.
|
String |
getZclass() |
boolean |
isCheckable()
Deprecated.
As of release 8.0.0, please use
isSelectable() |
boolean |
isDisabled()
Returns whether it is disabled.
|
boolean |
isLoaded()
Returns whether the content of this item is loaded.
|
boolean |
isSelectable()
Returns whether it is selectable.
|
boolean |
isSelected()
Returns whether it is selected.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setCheckable(boolean checkable)
Deprecated.
As of release 8.0.0, please use
setSelectable(boolean) |
void |
setDisabled(boolean disabled)
Sets whether it is disabled.
|
void |
setHflex(String flex)
Deprecated.
as of release 6.0.0. To control the size of Listbox related
components, please refer to
Listbox and Listheader instead. |
void |
setImage(String image)
Sets the image of the
Listcell it contains. |
protected void |
setIndex(int index) |
void |
setLabel(String label)
Sets the label of the
Listcell it contains. |
void |
setSelectable(boolean selectable)
Sets whether it is selectable.
|
void |
setSelected(boolean selected)
Sets whether it is selected.
|
void |
setSrc(String src)
Deprecated.
As of release 3.5.0, it is redundant since it
is the same
getSrc() . |
void |
setStubonly(boolean stubonly)
Deprecated.
as of release 7.0.3.
|
void |
setStubonly(String stubonly)
Deprecated.
as of release 7.0.3.
|
<T> void |
setValue(T value)
Sets the value.
|
boolean |
setVisible(boolean visible) |
void |
setWidth(String width)
Deprecated.
as of release 6.0.0. To control the size of Listbox related
components, please refer to
Listbox and Listheader instead. |
protected void |
smartUpdate(String name,
boolean value) |
protected void |
smartUpdate(String name,
int value) |
protected void |
smartUpdate(String name,
Object value) |
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
addSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, 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, getId, getLastChild, getListenerIterator, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
public Listitem()
public Listitem(String label)
public Listitem(String label, T value)
public Listbox getListbox()
It is the same as AbstractComponent.getParent()
.
public Listgroup getListgroup()
public String getZclass()
getZclass
in class org.zkoss.zk.ui.HtmlBasedComponent
public boolean isCheckable()
isSelectable()
public void setCheckable(boolean checkable)
setSelectable(boolean)
public boolean isSelectable()
Default: true.
public void setSelectable(boolean selectable)
If the listbox is in a checkmark mode, the selectable state will affect the checkable icon to display or not.
Default: true.
selectable
- public int getMaxlength()
public <T> T getValue()
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.
public <T> void setValue(T value)
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.
public void setStubonly(String stubonly)
setStubonly
in interface org.zkoss.zk.ui.Component
setStubonly
in class org.zkoss.zk.ui.AbstractComponent
public void setStubonly(boolean stubonly)
setStubonly
in interface org.zkoss.zk.ui.Component
setStubonly
in class org.zkoss.zk.ui.AbstractComponent
public boolean isDisabled()
Default: false.
public void setDisabled(boolean disabled)
public boolean isSelected()
Default: false.
public void setSelected(boolean selected)
public String getLabel()
Listcell
it contains, or null
if no such cell.public void setLabel(String label)
Listcell
it contains.
If it is not created, we automatically create it.
public String getSrc()
getImage()
.public void setSrc(String src)
getSrc()
.public void setImage(String image)
Listcell
it contains.
If it is not created, we automatically create it.
public int getIndex()
public boolean isLoaded()
getListbox()
is live data,
i.e., Listbox.getModel()
is not null.protected void setIndex(int index)
public boolean setVisible(boolean visible)
setVisible
in interface org.zkoss.zk.ui.Component
setVisible
in class org.zkoss.zk.ui.AbstractComponent
protected void smartUpdate(String name, Object value)
smartUpdate
in class org.zkoss.zk.ui.AbstractComponent
protected void smartUpdate(String name, boolean value)
smartUpdate
in class org.zkoss.zk.ui.AbstractComponent
protected void smartUpdate(String name, int value)
smartUpdate
in class org.zkoss.zk.ui.AbstractComponent
public String getMold()
getMold
in interface org.zkoss.zk.ui.Component
getMold
in class org.zkoss.zk.ui.AbstractComponent
public void setWidth(String width)
Listbox
and Listheader
instead.setWidth
in class org.zkoss.zk.ui.HtmlBasedComponent
public void setHflex(String flex)
Listbox
and Listheader
instead.setHflex
in class org.zkoss.zk.ui.HtmlBasedComponent
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
renderProperties
in class XulElement
IOException
protected void addMoved(org.zkoss.zk.ui.Component oldparent, org.zkoss.zk.ui.Page oldpg, org.zkoss.zk.ui.Page newpg)
addMoved
in class org.zkoss.zk.ui.AbstractComponent
public void beforeParentChanged(org.zkoss.zk.ui.Component parent)
beforeParentChanged
in interface org.zkoss.zk.ui.sys.ComponentCtrl
beforeParentChanged
in class org.zkoss.zk.ui.AbstractComponent
public void beforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component refChild)
beforeChildAdded
in interface org.zkoss.zk.ui.sys.ComponentCtrl
beforeChildAdded
in class org.zkoss.zk.ui.AbstractComponent
public Object clone()
clone
in interface org.zkoss.zk.ui.Component
clone
in class XulElement
public Object getExtraCtrl()
getExtraCtrl
in interface org.zkoss.zk.ui.sys.ComponentCtrl
getExtraCtrl
in class org.zkoss.zk.ui.HtmlBasedComponent
Copyright © 2019. All rights reserved.