org.zkoss.zul
Class Listbox

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Listbox
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HtmlBasedComponent, Component, Scope, ComponentCtrl, Listbox, Paginated, XulElement

public class Listbox
extends XulElement
implements Paginated, Listbox

A listbox.

Event:

  1. org.zkoss.zk.ui.event.SelectEvent is sent when user changes the selection.

See Specification.

Besides creating Listitem programmingly, you could assign a data model (a ListModel or GroupsModel instance) to a listbox via setModel(ListModel) or setModel(GroupsModel) and then the listbox will retrieve data via ListModel.getElementAt(int) when necessary.

Besides assign a list model, you could assign a renderer (a ListitemRenderer instance) to a listbox, such that the listbox will use this renderer to render the data returned by ListModel.getElementAt(int). If not assigned, the default renderer, which assumes a label per list item, is used. In other words, the default renderer adds a label to a Listitem by calling toString against the object returned by ListModel.getElementAt(int)

There are two ways to handle long content: scrolling and paging. If AbstractComponent.getMold() is "default", scrolling is used if HtmlBasedComponent.setHeight(java.lang.String) is called and too much content to display. If AbstractComponent.getMold() is "paging", paging is used if two or more pages are required. To control the number of items to display in a page, use setPageSize(int).

If paging is used, the page controller is either created automatically or assigned explicitly by setPaginal(org.zkoss.zul.ext.Paginal). The paging controller specified explicitly by setPaginal(org.zkoss.zul.ext.Paginal) is called the external page controller. It is useful if you want to put the paging controller at different location (other than as a child component), or you want to use the same controller to control multiple listboxes.

Default getZclass(): z-listbox.(since 3.5.0)

To have a list box without stripping, you can specify a non-existent style class to setOddRowSclass(java.lang.String).

Clustering and Serialization

When used in a clustering environment, you have to make ListitemRenderer (setItemRenderer(org.zkoss.zul.ListitemRenderer)) and ListModel ( setModel(org.zkoss.zul.ListModel)) either serializable or re-assign them when sessionDidActivate(org.zkoss.zk.ui.Page) is called.

Render on Demand (rod)

[ZK EE] [Since 5.0.0]

For huge data, you can turn on Listbox's ROD to request ZK engine to load from ListModel only the required data chunk and create only the required Listitems in memory and render only the required DOM elements in browser. So it saves both the memory and the processing time in both server and browser for huge data. If you don't use the ListModel with the Listbox, turn on the ROD will still have ZK engine to render only a chunk of DOM elements in browser so it at least saves the memory and processing time in browser. Note that ROD works only if the Listbox is configured to has a limited "view port" height. That is, either the Listbox is in the "paging" mold or you have to HtmlBasedComponent.setHeight(String),HtmlBasedComponent.setVflex(String), or setRows(int) of the Listbox to make ROD works.

You can turn on/off ROD for all Listboxes in the application or only for a specific Listbox. To turn on ROD for all Listboxes in the application, you have to specify the Library Property "org.zkoss.zul.listbox.rod" to "true" in WEB-INF/zk.xml. If you did not specify the Library Property, default is false.


        
                org.zkoss.zul.listbox.rod
                true
        
 

To turn on ROD for a specific Listbox, you have to specify the Listbox's attribute map with key "org.zkoss.zul.listbox.rod" to true. That is, for example, if in a zul file, you shall specify <custom-attributes> of the Listbox like this:


        
    
  
 

You can mix the Library Property and <custom-attributes> ways together. The <custom-attributes> way always takes higher priority. So you can turn OFF ROD in general and turn ON only some specific Listbox component. Or you can turn ON ROD in general and turn OFF only some specific Listbox component.

Since only partial Listitems are created and rendered in the Listbox if you turn the ROD on, there will be some limitations on accessing Listitems. For example, if you call


 Listitem itemAt100 = (Listitem) getItemAtIndex(100);
 

The Listitem in index 100 is not necessary created yet if it is not in the current "view port" and you will get "null" instead.

And it is generally a bad idea to "cache" the created Listitem in your application if you turn the ROD on because Listitems might be removed later. Basically, you shall operate on the item of the ListModel rather than on the Listitem of the Listbox if you use the ListModel and ROD.

To retrieve what are selected in ROD Listbox, you shall use Selectable.getSelection() to get what is currently selected object in ListModel rather than using getSelectedItems(). That is, you shall operate on the item of the ListModel rather than on the Listitem of the Listbox if you use the ListModel and ROD.


 Set selection = ((Selectable)getModel()).getSelection();
 

Author:
tomyeh
See Also:
ListModel, ListitemRenderer, ListitemRendererExt, Serialized Form

Nested Class Summary
protected  class Listbox.Children
           
protected  class Listbox.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
Field Summary
static java.lang.String LOADING_MODEL
           
static java.lang.String SYNCING_MODEL
           
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_height, _left, _top, _width, _zclass
 
Fields inherited from class org.zkoss.zk.ui.AbstractComponent
_visible
 
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
Listbox()
           
 
Method Summary
 void addItemToSelection(Listitem item)
          Selects the given item, without deselecting any other items that are already selected..
 void addItemToSelectionApi(Listitem itemApi)
          Selects the given item, without deselecting any other items that are already selected..
protected  void afterInsert(Component comp)
          Callback if a list item has been inserted.
 Listitem appendItem(java.lang.String label, java.lang.String value)
          Appends an item.
 Listitem appendItemApi(java.lang.String label, java.lang.String value)
          Appends an item.
 void beforeChildAdded(Component newChild, Component refChild)
          Default: does nothing.
protected  void beforeRemove(Component comp)
          Callback if a list item will be removed (not removed yet).
 void clearSelection()
          Clears the selection.
 java.lang.Object clone()
          Clones the component.
 int getActivePage()
          Returns the active page (starting from 0).
 Frozen getFrozen()
          Returns the frozen child.
 int getGroupCount()
          Returns the number of listgroup
 java.util.List getGroups()
          Returns a list of all Listgroup.
 GroupsModel getGroupsModel()
          Returns the groups model associated with this list box, or null if this list box is associated with a ListModel or not associated with any list data model.
 java.util.Collection getHeads()
          Returns a collection of heads, including getListhead() and auxiliary heads (Auxhead) (never null).
 int getIndexOfItem(Listitem item)
          Returns the index of the specified item, or -1 if not found.
 int getIndexOfItemApi(Listitem itemApi)
          Returns the index of the specified item, or -1 if not found.
 java.lang.String getInnerWidth()
          Returns the inner width of this component.
 Listitem getItemAtIndex(int index)
          Returns the item at the specified index.
 Listitem getItemAtIndexApi(int index)
          Returns the item at the specified index.
 int getItemCount()
          Returns the number of items.
 ListitemRenderer getItemRenderer()
          Returns the renderer to render each item, or null if the default renderer is used.
 java.util.List getItems()
          Returns a live list of all Listitem.
 Listfoot getListfoot()
          Returns Listfoot belonging to this listbox, or null if no list footers at all.
 Listfoot getListfootApi()
          Returns Listfoot belonging to this listbox, or null if no list footers at all.
 Listhead getListhead()
          Returns Listhead belonging to this listbox, or null if no list headers at all.
 Listhead getListheadApi()
          Returns Listhead belonging to this listbox, or null if no list headers at all.
 ListModel getListModel()
          Returns the list model associated with this list box, or null if this list box is associated with a GroupsModel or not associated with any list data model.
 int getMaxlength()
          Returns the maximal length of each item's label.
 ListModel getModel()
          Returns the model associated with this list box, or null if this list box is not associated with any list data model.
 java.lang.String getName()
          Returns the name of this component.
 java.lang.String getOddRowSclass()
          Returns the style class for the odd rows.
 int getPageCount()
          Returns the number of pages.
 int getPageSize()
          Returns the page size, aka., the number items per page.
 Paginal getPaginal()
          Returns the paging controller, or null if not available.
 Paging getPagingChild()
          Returns the child paging controller that is created automatically, or null if mold is not "paging", or the controller is specified externally by setPaginal(org.zkoss.zul.ext.Paginal).
 Paging getPagingChildApi()
          Returns the child paging controller that is created automatically, or null if mold is not "paging", or the controller is specified externally by setPaginal(org.zkoss.zul.ext.Paginal).
 java.lang.String getPagingPosition()
          Returns how to position the paging of listbox at the client screen.
 int getPreloadSize()
          Returns the number of items to preload when receiving the rendering request from the client.
 int getRows()
          Returns the rows.
 int getSelectedCount()
          Returns the number of items being selected.
 int getSelectedIndex()
          Returns the index of the selected item (-1 if no one is selected).
 Listitem getSelectedItem()
          Returns the selected item.
 Listitem getSelectedItemApi()
          Returns the selected item.
 java.util.Set getSelectedItems()
          Returns all selected items.
 java.lang.String getSeltype()
          Returns the seltype.
 int getTabindex()
          Returns the tab order of this component.
 java.util.Iterator getVisibleChildrenIterator()
          Returns an iterator to iterate thru all visible children.
 int getVisibleItemCount()
          Returns the number of visible descendant Listitem.
 java.lang.String getZclass()
          Returns the ZK Cascading Style class(es) for this component.
 boolean hasGroup()
          Returns whether listgroup exists.
 boolean insertBefore(Component newChild, Component refChild)
          Inserts a child before the reference child.
 boolean isCheckmark()
          Returns whether the check mark shall be displayed in front of each item.
 boolean isDisabled()
          Returns whether it is disabled.
 boolean isFixedLayout()
          Deprecated. since 5.0.0, use !isSizedByContent() instead
 boolean isMultiple()
          Returns whether multiple selections are allowed.
 boolean isSizedByContent()
          Returns whether sizing listbox column width by its content.
 boolean isVflex()
          Returns whether to grow and shrink vertical to fit their given space, so called vertial flexibility.
protected  java.util.List newChildren()
          Creates and returns the instance for storing child components.
protected  java.lang.Object newExtraCtrl()
          Used by AbstractComponent.getExtraCtrl() to create a client control.
 void onInitRender()
          Handles a private event, onInitRender.
 void onPageAttached(Page newpage, Page oldpage)
          Default: handles special event listeners.
 boolean removeChild(Component child)
          If the child is a listgroup, its listgroupfoot will be removed at the same time.
 Listitem removeItemAt(int index)
          Removes the child item in the list box at the given index.
 Listitem removeItemAtApi(int index)
          Removes the child item in the list box at the given index.
 void removeItemFromSelection(Listitem item)
          Deselects the given item without deselecting other items.
 void removeItemFromSelectionApi(Listitem itemApi)
          Deselects the given item without deselecting other items.
 void renderAll()
          Renders all Listitem if not loaded yet, with getItemRenderer().
 Listitem renderItem(Listitem li)
          Renders the specified Listitem if not loaded yet, with getItemRenderer().
 Listitem renderItemApi(Listitem itemApi)
          Renders the specified Listitem if not loaded yet, with getItemRenderer().
 void renderItems(java.util.Set items)
           
protected  void renderProperties(ContentRenderer renderer)
          Renders the content of this component, excluding the enclosing tags and children.
 void selectAll()
          Selects all items.
 void selectItem(Listitem item)
          Deselects all of the currently selected items and selects the given item.
 void selectItemApi(Listitem itemApi)
          Deselects all of the currently selected items and selects the given item.
 void service(AuRequest request, boolean everError)
          Processes an AU request.
 void sessionDidActivate(Page page)
          Notification that the session, which owns this component, has just been activated (aka., deserialized).
 void sessionWillPassivate(Page page)
          Notification that the session, which owns this component, is about to be passivated (aka., serialized).
 void setActivePage(int pg)
          Sets the active page (starting from 0).
 void setActivePage(Listitem item)
          Sets the active page in which the specified item is.
 void setActivePage(Listitem itemApi)
          Sets the active page in which the specified item is.
 void setCheckmark(boolean checkmark)
          Sets whether the check mark shall be displayed in front of each item.
 void setDisabled(boolean disabled)
          Sets whether it is disabled.
 void setFixedLayout(boolean fixedLayout)
          Deprecated. since 5.0.0, use setSizedByContent(boolean)(!fixedLayout) instead
 void setInnerWidth(java.lang.String innerWidth)
          Sets the inner width of this component.
 void setItemRenderer(ListitemRenderer renderer)
          Sets the renderer which is used to render each item if getModel() is not null.
 void setItemRenderer(java.lang.String clsnm)
          Sets the renderer by use of a class name.
 void setMaxlength(int maxlength)
          Sets the maximal length of each item's label.
 void setModel(GroupsModel model)
          Sets the groups model associated with this list box.
 void setModel(ListModel model)
          Sets the list model associated with this listbox.
 void setMold(java.lang.String mold)
          Sets the mold to render this component.
 void setMultiple(boolean multiple)
          Sets whether multiple selections are allowed.
 void setName(java.lang.String name)
          Sets the name of this component.
 void setOddRowSclass(java.lang.String scls)
          Sets the style class for the odd rows.
 void setPageSize(int pgsz)
          Sets the page size, aka., the number items per page.
 void setPaginal(Paginal pgi)
          Specifies the paging controller.
 void setPagingPosition(java.lang.String pagingPosition)
          Sets how to position the paging of listbox at the client screen.
 void setPreloadSize(int sz)
          Sets the number of items to preload when receiving the rendering request from the client.
 void setRows(int rows)
          Sets the rows.
 void setSelectedIndex(int jsel)
          Deselects all of the currently selected items and selects the item with the given index.
 void setSelectedItem(Listitem item)
          Deselects all of the currently selected items and selects the given item.
 void setSelectedItemApi(Listitem itemApi)
          Deselects all of the currently selected items and selects the given item.
 void setSelectedItems(java.util.Set listItems)
          Selects the given listitems.
 void setSeltype(java.lang.String seltype)
          Sets the seltype.
 void setSizedByContent(boolean byContent)
          Sets whether sizing listbox column width by its content.
 void setTabindex(int tabindex)
          Sets the tab order of this component.
 void setVflex(boolean vflex)
          Sets whether to grow and shrink vertical to fit their given space, so called vertial flexibility.
protected  void smartUpdate(java.lang.String attr, java.lang.Object value)
          Smart-updates a property of the peer widget associated with the component, running at the client, with the specified value.
 void toggleItemSelection(Listitem item)
          If the specified item is selected, it is deselected.
 void toggleItemSelectionApi(Listitem itemApi)
          If the specified item is selected, it is deselected.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getDraggable, getDroppable, getHeight, getHflex, getLeft, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, setClass, setDraggable, setDroppable, setFocus, setHeight, setHflex, setLeft, setSclass, setStyle, setTooltiptext, setTop, setVflex, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, containsVariable, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getClientEvents, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageDetached, onWrongValue, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, response, setAttribute, setAttribute, setAttribute, setAuService, setDefinition, setDefinition, setId, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, unsetVariable, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Field Detail

LOADING_MODEL

public static final java.lang.String LOADING_MODEL
See Also:
Constant Field Values

SYNCING_MODEL

public static final java.lang.String SYNCING_MODEL
See Also:
Constant Field Values
Constructor Detail

Listbox

public Listbox()
Method Detail

newChildren

protected java.util.List newChildren()
Description copied from class: AbstractComponent
Creates and returns the instance for storing child components.

Default: it instantiates AbstractComponent.Children.

Overrides:
newChildren in class AbstractComponent

setFixedLayout

public void setFixedLayout(boolean fixedLayout)
Deprecated. since 5.0.0, use setSizedByContent(boolean)(!fixedLayout) instead

Description copied from interface: Listbox
Sets the outline of listbox whether is fixed layout. If true, the outline of grid will be depended on browser. It means, we don't calculate the width of each cell. Otherwise, the outline will count on the content of body. In other words, the outline of grid is like ZK 2.4.1 version that the header's width is only for reference.

You can also specify the "fixed-layout" attribute of component in lang-addon.xml directly, it's a top priority.

Specified by:
setFixedLayout in interface Listbox
Parameters:
fixedLayout - true to outline this listbox by browser

isFixedLayout

public boolean isFixedLayout()
Deprecated. since 5.0.0, use !isSizedByContent() instead

Description copied from interface: Listbox
Returns the outline of listbox whether is fixed layout.

Default: false.

Note: if the "fixed-layout" attribute of component is specified, it's prior to the original value.

Specified by:
isFixedLayout in interface Listbox

setSizedByContent

public void setSizedByContent(boolean byContent)
Sets whether sizing listbox column width by its content. Default is false, i.e. the outline of listbox is dependent on browser. It means, we don't calculate the width of each cell. if set to true, the outline will count on the content of body. In other words, the outline of listbox will be like ZK version 2.4.1 that the header's width is only for reference.

You can also specify the "sized-by-content" attribute of component in lang-addon.xml directly, it will then take higher priority.

Specified by:
setSizedByContent in interface Listbox
Parameters:
byContent -
Since:
5.0.0

isSizedByContent

public boolean isSizedByContent()
Returns whether sizing listbox column width by its content. Default is false.

Note: if the "sized-by-content" attribute of component is specified, it's prior to the original value.

Specified by:
isSizedByContent in interface Listbox
Since:
5.0.0
See Also:
setSizedByContent(boolean)

getListhead

public Listhead getListhead()
Returns Listhead belonging to this listbox, or null if no list headers at all.


getListheadApi

public Listhead getListheadApi()
Returns Listhead belonging to this listbox, or null if no list headers at all.

Specified by:
getListheadApi in interface Listbox
Since:
3.5.2

getListfoot

public Listfoot getListfoot()
Returns Listfoot belonging to this listbox, or null if no list footers at all.


getFrozen

public Frozen getFrozen()
Returns the frozen child.

Since:
5.0.0

getListfootApi

public Listfoot getListfootApi()
Returns Listfoot belonging to this listbox, or null if no list footers at all.

Specified by:
getListfootApi in interface Listbox
Since:
3.5.2

getHeads

public java.util.Collection getHeads()
Returns a collection of heads, including getListhead() and auxiliary heads (Auxhead) (never null).

Specified by:
getHeads in interface Listbox
Since:
3.0.0

isCheckmark

public boolean isCheckmark()
Returns whether the check mark shall be displayed in front of each item.

Default: false.


setCheckmark

public void setCheckmark(boolean checkmark)
Sets whether the check mark shall be displayed in front of each item.

The check mark is a checkbox if isMultiple() returns true. It is a radio button if isMultiple() returns false.

Specified by:
setCheckmark in interface Listbox

setInnerWidth

public void setInnerWidth(java.lang.String innerWidth)
Sets the inner width of this component. The inner width is the width of the inner table. By default, it is 100%. That is, it is the same as the width of this component. However, it is changed when the user is sizing the column's width.

Application developers rarely call this method, unless they want to preserve the widths of sizable columns changed by the user. To preserve the widths, the developer have to store the widths of all columns and the inner width (getInnerWidth()), and then restore them when re-creating this component.

Specified by:
setInnerWidth in interface Listbox
Parameters:
innerWidth - the inner width. If null, "100%" is assumed.
Since:
3.0.0

getInnerWidth

public java.lang.String getInnerWidth()
Returns the inner width of this component. The inner width is the width of the inner table.

Default: "100%"

Specified by:
getInnerWidth in interface Listbox
Since:
3.0.0
See Also:
setInnerWidth(java.lang.String)

isVflex

public boolean isVflex()
Returns whether to grow and shrink vertical to fit their given space, so called vertial flexibility.

Note: this attribute is ignored if setRows(int) is specified

Default: false.


setVflex

public void setVflex(boolean vflex)
Sets whether to grow and shrink vertical to fit their given space, so called vertial flexibility.

Note: this attribute is ignored if setRows(int) is specified

Specified by:
setVflex in interface Listbox

isDisabled

public boolean isDisabled()
Returns whether it is disabled.

Default: false.


setDisabled

public void setDisabled(boolean disabled)
Sets whether it is disabled.

Specified by:
setDisabled in interface Listbox

getTabindex

public int getTabindex()
Returns the tab order of this component.

Currently, only the "select" mold supports this property.

Default: -1 (means the same as browser's default).

Specified by:
getTabindex in interface Listbox

setTabindex

public void setTabindex(int tabindex)
                 throws WrongValueException
Sets the tab order of this component.

Currently, only the "select" mold supports this property.

Specified by:
setTabindex in interface Listbox
Throws:
WrongValueException

getRows

public int getRows()
Returns the rows. Zero means no limitation.

Default: 0.

Specified by:
getRows in interface Listbox

setRows

public void setRows(int rows)
             throws WrongValueException
Sets the rows.

Note: if both HtmlBasedComponent.setHeight(java.lang.String) is specified with non-empty, setRows(int) is ignored

Specified by:
setRows in interface Listbox
Throws:
WrongValueException

getSeltype

public java.lang.String getSeltype()
Returns the seltype.

Default: "single".

Specified by:
getSeltype in interface Listbox

setSeltype

public void setSeltype(java.lang.String seltype)
                throws WrongValueException
Sets the seltype.

Specified by:
setSeltype in interface Listbox
Throws:
WrongValueException

isMultiple

public boolean isMultiple()
Returns whether multiple selections are allowed.

Default: false.

Specified by:
isMultiple in interface Listbox

setMultiple

public void setMultiple(boolean multiple)
Sets whether multiple selections are allowed.

Specified by:
setMultiple in interface Listbox

getMaxlength

public int getMaxlength()
Returns the maximal length of each item's label.

Specified by:
getMaxlength in interface Listbox

setMaxlength

public void setMaxlength(int maxlength)
Sets the maximal length of each item's label.

It is meaningful only for the select mold.

Specified by:
setMaxlength in interface Listbox

getName

public java.lang.String getName()
Returns the name of this component.

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.

Specified by:
getName in interface Listbox

setName

public void setName(java.lang.String name)
Sets the name of this component.

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.

Specified by:
setName in interface Listbox
Parameters:
name - the name of this component.

getItems

public java.util.List getItems()
Returns a live list of all Listitem. By live we mean you can add or remove them directly with the List interface. In other words, you could add or remove an item by manipulating the returned list directly.

Specified by:
getItems in interface Listbox

getItemCount

public int getItemCount()
Returns the number of items.

Specified by:
getItemCount in interface Listbox

getItemAtIndex

public Listitem getItemAtIndex(int index)
Returns the item at the specified index.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).


getItemAtIndexApi

public Listitem getItemAtIndexApi(int index)
Returns the item at the specified index.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).

Specified by:
getItemAtIndexApi in interface Listbox
Since:
3.5.2

getIndexOfItem

public int getIndexOfItem(Listitem item)
Returns the index of the specified item, or -1 if not found.


getIndexOfItemApi

public int getIndexOfItemApi(Listitem itemApi)
Returns the index of the specified item, or -1 if not found.

Specified by:
getIndexOfItemApi in interface Listbox
Parameters:
itemApi - assume as a Listitem
Since:
3.5.2

getSelectedIndex

public int getSelectedIndex()
Returns the index of the selected item (-1 if no one is selected).

Specified by:
getSelectedIndex in interface Listbox

setSelectedIndex

public void setSelectedIndex(int jsel)
Deselects all of the currently selected items and selects the item with the given index.

Specified by:
setSelectedIndex in interface Listbox

selectItem

public void selectItem(Listitem item)
Deselects all of the currently selected items and selects the given item.

It is the same as setSelectedItem(org.zkoss.zul.Listitem).

Parameters:
item - the item to select. If null, all items are deselected.

selectItemApi

public void selectItemApi(Listitem itemApi)
Deselects all of the currently selected items and selects the given item.

It is the same as setSelectedItem(org.zkoss.zul.Listitem).

Specified by:
selectItemApi in interface Listbox
Parameters:
itemApi - assume as a Listitem
Since:
3.5.2

addItemToSelection

public void addItemToSelection(Listitem item)
Selects the given item, without deselecting any other items that are already selected..


addItemToSelectionApi

public void addItemToSelectionApi(Listitem itemApi)
Selects the given item, without deselecting any other items that are already selected..

Specified by:
addItemToSelectionApi in interface Listbox
Parameters:
itemApi - assume as a Listitem
Since:
3.5.2

removeItemFromSelection

public void removeItemFromSelection(Listitem item)
Deselects the given item without deselecting other items.


removeItemFromSelectionApi

public void removeItemFromSelectionApi(Listitem itemApi)
Deselects the given item without deselecting other items.

Specified by:
removeItemFromSelectionApi in interface Listbox
Parameters:
itemApi - assume as a Listitem
Since:
3.5.2

toggleItemSelection

public void toggleItemSelection(Listitem item)
If the specified item is selected, it is deselected. If it is not selected, it is selected. Other items in the list box that are selected are not affected, and retain their selected state.


toggleItemSelectionApi

public void toggleItemSelectionApi(Listitem itemApi)
If the specified item is selected, it is deselected. If it is not selected, it is selected. Other items in the list box that are selected are not affected, and retain their selected state.

Specified by:
toggleItemSelectionApi in interface Listbox
Parameters:
itemApi - assume as a Listitem
Since:
3.5.2

clearSelection

public void clearSelection()
Clears the selection.

Specified by:
clearSelection in interface Listbox

selectAll

public void selectAll()
Selects all items.

Specified by:
selectAll in interface Listbox

getSelectedItem

public Listitem getSelectedItem()
Returns the selected item.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).


getSelectedItemApi

public Listitem getSelectedItemApi()
Returns the selected item.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).

Specified by:
getSelectedItemApi in interface Listbox
Since:
3.5.2

setSelectedItem

public void setSelectedItem(Listitem item)
Deselects all of the currently selected items and selects the given item.

It is the same as selectItem(org.zkoss.zul.Listitem).


setSelectedItemApi

public void setSelectedItemApi(Listitem itemApi)
Deselects all of the currently selected items and selects the given item.

It is the same as selectItem(org.zkoss.zul.Listitem).

Specified by:
setSelectedItemApi in interface Listbox
Parameters:
itemApi - assume as a Listitem
Since:
3.5.2

setSelectedItems

public void setSelectedItems(java.util.Set listItems)
Selects the given listitems.

Since:
3.6.0

getSelectedItems

public java.util.Set getSelectedItems()
Returns all selected items.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).

Specified by:
getSelectedItems in interface Listbox

getSelectedCount

public int getSelectedCount()
Returns the number of items being selected.

Specified by:
getSelectedCount in interface Listbox

appendItem

public Listitem appendItem(java.lang.String label,
                           java.lang.String value)
Appends an item.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).


appendItemApi

public Listitem appendItemApi(java.lang.String label,
                              java.lang.String value)
Appends an item.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).

Specified by:
appendItemApi in interface Listbox
Since:
3.5.2

removeItemAt

public Listitem removeItemAt(int index)
Removes the child item in the list box at the given index.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).

Returns:
the removed item.

removeItemAtApi

public Listitem removeItemAtApi(int index)
Removes the child item in the list box at the given index.

Note: if live data is used (getModel() is not null), the returned item might NOT be loaded yet. To ensure it is loaded, you have to invoke renderItem(org.zkoss.zul.Listitem).

Specified by:
removeItemAtApi in interface Listbox
Returns:
the removed item.
Since:
3.5.2

setPagingPosition

public void setPagingPosition(java.lang.String pagingPosition)
Sets how to position the paging of listbox at the client screen. It is meaningless if the mold is not in "paging".

Specified by:
setPagingPosition in interface Listbox
Parameters:
pagingPosition - how to position. It can only be "bottom" (the default), or "top", or "both".
Since:
3.0.4

getPagingPosition

public java.lang.String getPagingPosition()
Returns how to position the paging of listbox at the client screen. It is meaningless if the mold is not in "paging".

Specified by:
getPagingPosition in interface Paginated
Since:
3.0.4

getPaginal

public Paginal getPaginal()
Returns the paging controller, or null if not available. Note: the paging controller is used only if AbstractComponent.getMold() is "paging".

If mold is "paging", this method never returns null, because a child paging controller is created automcatically (if not specified by developers with setPaginal(org.zkoss.zul.ext.Paginal)).

If a paging controller is specified (either by setPaginal(org.zkoss.zul.ext.Paginal), or by setMold(java.lang.String) with "paging"), the listbox will rely on the paging controller to handle long-content instead of scrolling.

Specified by:
getPaginal in interface Listbox

setPaginal

public void setPaginal(Paginal pgi)
Description copied from interface: Listbox
Specifies the paging controller. Note: the paging controller is used only if Component.getMold() is "paging".

It is OK, though without any effect, to specify a paging controller even if mold is not "paging".

Specified by:
setPaginal in interface Listbox
Parameters:
pgi - the paging controller. If null and Component.getMold() is "paging", a paging controller is created automatically as a child component (see Listbox.getPagingChildApi()).

getPagingChild

public Paging getPagingChild()
Returns the child paging controller that is created automatically, or null if mold is not "paging", or the controller is specified externally by setPaginal(org.zkoss.zul.ext.Paginal).

Since:
3.0.7

getPagingChildApi

public Paging getPagingChildApi()
Returns the child paging controller that is created automatically, or null if mold is not "paging", or the controller is specified externally by setPaginal(org.zkoss.zul.ext.Paginal).

Specified by:
getPagingChildApi in interface Listbox
Since:
3.5.2

getPageSize

public int getPageSize()
Returns the page size, aka., the number items per page.

Specified by:
getPageSize in interface Listbox
Throws:
java.lang.IllegalStateException - if getPaginal() returns null, i.e., mold is not "paging" and no external controller is specified.

setPageSize

public void setPageSize(int pgsz)
                 throws WrongValueException
Sets the page size, aka., the number items per page.

Specified by:
setPageSize in interface Listbox
Throws:
java.lang.IllegalStateException - if getPaginal() returns null, i.e., mold is not "paging" and no external controller is specified.
WrongValueException

getPageCount

public int getPageCount()
Returns the number of pages. Note: there is at least one page even no item at all.

Specified by:
getPageCount in interface Listbox
Since:
3.0.4

getActivePage

public int getActivePage()
Returns the active page (starting from 0).

Specified by:
getActivePage in interface Listbox
Since:
3.0.4

setActivePage

public void setActivePage(int pg)
                   throws WrongValueException
Sets the active page (starting from 0).

Specified by:
setActivePage in interface Listbox
Throws:
WrongValueException
Since:
3.0.4
See Also:
setActivePage(Listitem)

setActivePage

public void setActivePage(Listitem item)
Sets the active page in which the specified item is. The active page will become the page that contains the specified item.

Parameters:
item - the item to show. If the item is null or doesn't belong to this listbox, nothing happens.
Since:
3.0.4
See Also:
setActivePage(int)

setActivePage

public void setActivePage(Listitem itemApi)
Sets the active page in which the specified item is. The active page will become the page that contains the specified item.

Specified by:
setActivePage in interface Listbox
Parameters:
itemApi - assume as a Listitem
Since:
3.5.2
See Also:
setActivePage(int)

getVisibleItemCount

public int getVisibleItemCount()
Returns the number of visible descendant Listitem.

Specified by:
getVisibleItemCount in interface Listbox
Since:
3.5.1

getOddRowSclass

public java.lang.String getOddRowSclass()
Returns the style class for the odd rows.

Default: getZclass()-odd. (since 3.5.0)

Specified by:
getOddRowSclass in interface Listbox
Since:
3.0.0

setOddRowSclass

public void setOddRowSclass(java.lang.String scls)
Sets the style class for the odd rows. If the style class doesn't exist, the striping effect disappears. You can provide different effects by providing the proper style classes.

Specified by:
setOddRowSclass in interface Listbox
Since:
3.0.0

getGroupCount

public int getGroupCount()
Returns the number of listgroup

Specified by:
getGroupCount in interface Listbox
Since:
3.5.0

getGroups

public java.util.List getGroups()
Returns a list of all Listgroup.

Specified by:
getGroups in interface Listbox
Since:
3.5.0

hasGroup

public boolean hasGroup()
Returns whether listgroup exists.

Specified by:
hasGroup in interface Listbox
Since:
3.5.0

smartUpdate

protected void smartUpdate(java.lang.String attr,
                           java.lang.Object value)
Description copied from class: AbstractComponent
Smart-updates a property of the peer widget associated with the component, running at the client, with the specified value.

The second invocation with the same property will replace the previous call. In other words, the same property will be set only once in each execution.

This method has no effect if AbstractComponent.invalidate() is ever invoked (in the same execution), since AbstractComponent.invalidate() assumes the whole content shall be redrawn and all smart updates to this components can be ignored,

Once AbstractComponent.invalidate() is called, all invocations to AbstractComponent.smartUpdate(java.lang.String, java.lang.Object) will then be ignored, and AbstractComponent.redraw(java.io.Writer) will be invoked later.

It can be called only in the request-processing and event-processing phases; excluding the redrawing phase.

There are two ways to draw a component, one is to invoke Component.invalidate(), and the other is AbstractComponent.smartUpdate(java.lang.String, java.lang.Object). While Component.invalidate() causes the whole content to redraw, AbstractComponent.smartUpdate(java.lang.String, java.lang.Object) let component developer control which part to redraw.

Overrides:
smartUpdate in class AbstractComponent
value - the new value. If it is DeferredValue, the value will be retrieved (by calling DeferredValue.getValue()) in the rendering phase. It is useful if the value can not be determined now.

For some old application servers (example, Webshpere 5.1), Execution.encodeURL(java.lang.String) cannot be called in the event processing thread. So, the developers have to use DeferredValue or disable the use of the event processing thread (by use of disable-event-thread in zk.xml).

In addition, the value can be any kind of objects that the client accepts (marshaled by JSON).

See Also:
AbstractComponent.updateByClient(java.lang.String, java.lang.Object)

beforeChildAdded

public void beforeChildAdded(Component newChild,
                             Component refChild)
Description copied from class: AbstractComponent
Default: does nothing.

Specified by:
beforeChildAdded in interface ComponentCtrl
Overrides:
beforeChildAdded in class AbstractComponent
Parameters:
newChild - the child to be added (never null).
refChild - another child component that the new child will be inserted before it. If null, the new child will be the last child.
See Also:
ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)

insertBefore

public boolean insertBefore(Component newChild,
                            Component refChild)
Description copied from interface: Component
Inserts a child before the reference child.

You could use Component.setParent(org.zkoss.zk.ui.Component) or Component.appendChild(org.zkoss.zk.ui.Component) instead of this method, unless you want to control where to put the child.

Note: Component.setParent(org.zkoss.zk.ui.Component) always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and/or Component.removeChild(org.zkoss.zk.ui.Component), while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.removeChild(org.zkoss.zk.ui.Component) always calls back Component.setParent(org.zkoss.zk.ui.Component), if the parent is changed. Thus, you don't need to override both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.setParent(org.zkoss.zk.ui.Component), if you want to customize the behavior.

Specified by:
insertBefore in interface Component
Overrides:
insertBefore in class AbstractComponent
Parameters:
newChild - the new child to be inserted.
refChild - the child before which you want the new child being inserted. If null, the new child is append to the end.
Returns:
true if newChild is added successfully or moved; false if it already has the specified child and the order doesn't change.

removeChild

public boolean removeChild(Component child)
If the child is a listgroup, its listgroupfoot will be removed at the same time.

Specified by:
removeChild in interface Component
Overrides:
removeChild in class AbstractComponent
Returns:
true if child is removed successfully; false if it doesn't have the specified child

afterInsert

protected void afterInsert(Component comp)
Callback if a list item has been inserted.

Note: it won't be called if other kind of child is inserted.

When this method is called, the index is correct.

Default: invalidate if it is the paging mold and it affects the view of the active page.

Since:
3.0.5

beforeRemove

protected void beforeRemove(Component comp)
Callback if a list item will be removed (not removed yet). Note: it won't be called if other kind of child is removed.

Default: invalidate if it is the paging mold and it affects the view of the active page.

Since:
3.0.5

getVisibleChildrenIterator

public java.util.Iterator getVisibleChildrenIterator()
Returns an iterator to iterate thru all visible children. Unlike getVisibleItemCount(), it handles only the direct children. Component developer only.

Since:
3.5.1

getModel

public ListModel getModel()
Returns the model associated with this list box, or null if this list box is not associated with any list data model.

Note: if setModel(GroupsModel) was called with a groups model, this method returns an instance of ListModel encapsulating it.

Specified by:
getModel in interface Listbox
See Also:
setModel(ListModel), setModel(GroupsModel)

getListModel

public ListModel getListModel()
Returns the list model associated with this list box, or null if this list box is associated with a GroupsModel or not associated with any list data model.

Specified by:
getListModel in interface Listbox
Since:
3.5.0
See Also:
setModel(ListModel)

getGroupsModel

public GroupsModel getGroupsModel()
Returns the groups model associated with this list box, or null if this list box is associated with a ListModel or not associated with any list data model.

Specified by:
getGroupsModel in interface Listbox
Since:
3.5.0
See Also:
setModel(GroupsModel)

setModel

public void setModel(ListModel model)
Sets the list model associated with this listbox. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.

Specified by:
setModel in interface Listbox
Parameters:
model - the list model to associate, or null to dis-associate any previous model.
Throws:
UiException - if failed to initialize with the model
See Also:
getListModel(), setModel(GroupsModel)

setModel

public void setModel(GroupsModel model)
Sets the groups model associated with this list box. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.

The groups model is used to represent a list of data with grouping.

Specified by:
setModel in interface Listbox
Parameters:
model - the groups model to associate, or null to dis-associate any previous model.
Throws:
UiException - if failed to initialize with the model
Since:
3.5.0
See Also:
setModel(ListModel), getGroupsModel()

getItemRenderer

public ListitemRenderer getItemRenderer()
Returns the renderer to render each item, or null if the default renderer is used.

Specified by:
getItemRenderer in interface Listbox

setItemRenderer

public void setItemRenderer(ListitemRenderer renderer)
Sets the renderer which is used to render each item if getModel() is not null.

Note: changing a render will not cause the listbox to re-render. If you want it to re-render, you could assign the same model again (i.e., setModel(getModel())), or fire an ListDataEvent event.

Specified by:
setItemRenderer in interface Listbox
Parameters:
renderer - the renderer, or null to use the default.
Throws:
UiException - if failed to initialize with the model

setItemRenderer

public void setItemRenderer(java.lang.String clsnm)
                     throws java.lang.ClassNotFoundException,
                            java.lang.NoSuchMethodException,
                            java.lang.IllegalAccessException,
                            java.lang.InstantiationException,
                            java.lang.reflect.InvocationTargetException
Sets the renderer by use of a class name. It creates an instance automatically.

Specified by:
setItemRenderer in interface Listbox
Throws:
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException

getPreloadSize

public int getPreloadSize()
Returns the number of items to preload when receiving the rendering request from the client.

Default: 7.

It is used only if live data (setModel(ListModel) and not paging (getPagingChild().

Note: if the "pre-load-size" attribute of component is specified, it's prior to the original value.(@since 3.0.4)

Specified by:
getPreloadSize in interface Listbox
Since:
2.4.1

setPreloadSize

public void setPreloadSize(int sz)
Sets the number of items to preload when receiving the rendering request from the client.

It is used only if live data (setModel(ListModel) and not paging (getPagingChild().

Specified by:
setPreloadSize in interface Listbox
Parameters:
sz - the number of items to preload. If zero, no preload at all.
Throws:
UiException - if sz is negative
Since:
2.4.1

onInitRender

public void onInitRender()
Handles a private event, onInitRender. It is used only for implementation, and you rarely need to invoke it explicitly.


renderItem

public Listitem renderItem(Listitem li)
Renders the specified Listitem if not loaded yet, with getItemRenderer().

It does nothing if getModel() returns null. In other words, it is meaningful only if live data model is used.

Returns:
the list item being passed to this method
See Also:
renderItems(java.util.Set), renderAll()

renderItemApi

public Listitem renderItemApi(Listitem itemApi)
Renders the specified Listitem if not loaded yet, with getItemRenderer().

It does nothing if getModel() returns null. In other words, it is meaningful only if live data model is used.

Specified by:
renderItemApi in interface Listbox
Parameters:
itemApi - assume as a Listitem
Returns:
the list item being passed to this method
Since:
3.5.2
See Also:
renderItems(java.util.Set), renderAll()

renderAll

public void renderAll()
Renders all Listitem if not loaded yet, with getItemRenderer().

Specified by:
renderAll in interface Listbox
See Also:
renderItem(org.zkoss.zul.Listitem), renderItems(java.util.Set)

renderItems

public void renderItems(java.util.Set items)
Specified by:
renderItems in interface Listbox

setMold

public void setMold(java.lang.String mold)
Description copied from interface: Component
Sets the mold to render this component.

Specified by:
setMold in interface Component
Overrides:
setMold in class AbstractComponent
Parameters:
mold - the mold. If null or empty, "default" is assumed.
See Also:
ComponentDefinition

getZclass

public java.lang.String getZclass()
Description copied from class: HtmlBasedComponent
Returns the ZK Cascading Style class(es) for this component. It usually depends on the implementation of the mold (@{link #getMold}).

Default: null (the default value depends on element).

HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style of a component. In other words, the default style of a component is associated with the default value of HtmlBasedComponent.getZclass(). Once it is changed, the default style won't be applied at all. If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String) instead.

Specified by:
getZclass in interface HtmlBasedComponent
Overrides:
getZclass in class HtmlBasedComponent
See Also:
HtmlBasedComponent.getSclass()

onPageAttached

public void onPageAttached(Page newpage,
                           Page oldpage)
Description copied from class: AbstractComponent
Default: handles special event listeners.

Specified by:
onPageAttached in interface ComponentCtrl
Overrides:
onPageAttached in class AbstractComponent
Parameters:
newpage - the new page (never null).
oldpage - the previous page, if any, or null if it didn't belong to any page.
See Also:
ComponentCtrl.onPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Page)

clone

public java.lang.Object clone()
Description copied from interface: Component
Clones the component. All of its children is cloned. Notice that the cloned component doesn't belong to any page, nor desktop. It doesn't have parent, either.

Specified by:
clone in interface Component
Overrides:
clone in class AbstractComponent

sessionWillPassivate

public void sessionWillPassivate(Page page)
Description copied from interface: ComponentCtrl
Notification that the session, which owns this component, is about to be passivated (aka., serialized).

Note: only root components are notified by this method.

Specified by:
sessionWillPassivate in interface ComponentCtrl
Overrides:
sessionWillPassivate in class AbstractComponent

sessionDidActivate

public void sessionDidActivate(Page page)
Description copied from interface: ComponentCtrl
Notification that the session, which owns this component, has just been activated (aka., deserialized).

Note: only root components are notified by this method.

Specified by:
sessionDidActivate in interface ComponentCtrl
Overrides:
sessionDidActivate in class AbstractComponent

renderProperties

protected void renderProperties(ContentRenderer renderer)
                         throws java.io.IOException
Description copied from class: HtmlBasedComponent
Renders the content of this component, excluding the enclosing tags and children.

See also Render Special Properties

Overrides:
renderProperties in class XulElement
Throws:
java.io.IOException

service

public void service(AuRequest request,
                    boolean everError)
Processes an AU request.

Default: in addition to what are handled by HtmlBasedComponent.service(org.zkoss.zk.au.AuRequest, boolean), it also handles onSelect.

Specified by:
service in interface ComponentCtrl
Overrides:
service in class HtmlBasedComponent
everError - whether any error ever occured before processing this request.
Since:
5.0.0
See Also:
AbstractComponent.setAuService(org.zkoss.zk.au.AuService)

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Description copied from class: HtmlBasedComponent
Used by AbstractComponent.getExtraCtrl() to create a client control. It is used only by component developers.

Defaut: creates an instance of HtmlBasedComponent.ExtraCtrl.

Overrides:
newExtraCtrl in class HtmlBasedComponent


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo