Class Biglistbox
- All Implemented Interfaces:
Serializable,Cloneable,Component,Scope,ComponentCtrl
Listbox including selection,
sorting, keystroke navigation, ROD(rendering-on-demand), and so on.
Event:
SelectEventis sent when user changes the selection.ScrollEventExtfor onScroll is sent when user changes the scroll position either x or y.ScrollEventExtfor onScrollY is sent when user changes the scroll position y.ScrollEventExtfor onScrollX is sent when user changes the scroll position x.SortEventExtis sent when user sort the column.CellClickEventis sent when user click upon the cell field.- onAfterRender is sent when the model's data has been rendered.
Custom Attributes
Default getZclass(): z-biglistbox.
Note: This component can only support those browsers which support HTML5/CSS3 selector. Like IE8+, Firefox, Safari, Opera, and Chrome.
- Since:
- 6.0.1
- Author:
- jumperchen
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
HtmlBasedComponent.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children, AbstractComponent.ForwardInfo, 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 TypeMethodDescriptionintgetCols()Returns the number of columns within the viewport.Returns the width of the single columnintReturns the size of the frozen columns.<T> MatrixRenderer<T>Returns the matrix renderer.MatrixModel<?,?, ?, ?> getModel()Returns the matrix model.Returns the style class for the odd rows.intReturns the number of items to preload when receiving the rendering request from the client.<T> MatrixRenderer<T>Return the real matrix renderer, ifgetMatrixRenderer()is null, the default implementation is assumed.Returns the height of the single row.intgetRows()Returns the rows' size of the viewport.intReturns the index of the selected item (-1 if no one is selected).Returns the selected object.Returns the sortable model, if any.Returns the ascending sorter provider, or null if not available.Returns the descending sorter provider, or null if not available.The default zclass is "z-biglistbox"voidInvalidates this component by setting the dirty flag such that it will be redraw the whole content of this component and its dependencies later.booleanReturns whether enables the auto adjusting cols size.booleanReturns whether enables the auto adjusting rows size.protected booleanReturns whether this component can have a child.booleanReturns whether is fix frozen columns, that means user cannot change the size of the frozen columns dynamically.voidHandles a private event, onInitRender.voidonPageAttached(Page newpage, Page oldpage) Default: handles special event listeners.voidonPageDetached(Page page) Default: handles special event listeners.voidonSort(SortEventExt event) protected voidrenderProperties(ContentRenderer renderer) Renders the content of this component, excluding the enclosing tags and children.voidProcesses an AU request.voidsessionDidActivate(Page page) Notification that the session, which owns this component, has just been activated (a.k.a., deserialized).voidsessionWillPassivate(Page page) Notification that the session, which owns this component, is about to be passivated (a.k.a., serialized).voidsetAutoCols(boolean autoCols) Sets whether enables auto adjusting the number of cols.voidsetAutoRows(boolean autoRows) Sets whether enables auto adjusting the number of rows.voidsetCols(int cols) Sets the number of columns within the viewport.voidsetColWidth(String colWidth) Sets the width of the single column.voidsetFixFrozenCols(boolean fixFrozenCols) Sets to fix the frozen columns, if true, meaning the user cannot change the size of the frozen columns dynamically.voidsetFrozenCols(int fcols) Sets the size of the frozen columns.voidsetMatrixRenderer(String clsnm) Sets the matrix renderer from a class string.voidsetMatrixRenderer(MatrixRenderer<?> renderer) Sets the matrix renderer.voidsetModel(MatrixModel<?, ?, ?, ?> model) Sets the matrix model.voidsetOddRowSclass(String scls) Sets the style class for the odd rows.voidsetRowHeight(String rowHeight) Sets the height of the single row.voidsetRows(int rows) Sets the rows' size of the viewport.voidsetSortAscending(String clsnm) Sets the ascending sorter provider with the class name, or null for no sorter for the ascending order.voidsetSortAscending(MatrixComparatorProvider<?> sorter) Sets the ascending sorter provider, or null for no sorter for the ascending order.voidsetSortDescending(String clsnm) Sets the descending sorter provider with the class name, or null for no sorter for the descending order.voidsetSortDescending(MatrixComparatorProvider<?> sorter) Sets the descending sorter provider, or null for no sorter for the descending order.booleansort(boolean ascending, int columnIndex) Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, 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, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setSkeleton, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, 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, getMold, 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, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, 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, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setStubonlyDescendants, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Constructor Details
-
Biglistbox
public Biglistbox()
-
-
Method Details
-
setAutoCols
public void setAutoCols(boolean autoCols) Sets whether enables auto adjusting the number of cols.Default: true.
-
isAutoCols
public boolean isAutoCols()Returns whether enables the auto adjusting cols size.Default: true.
-
setAutoRows
public void setAutoRows(boolean autoRows) Sets whether enables auto adjusting the number of rows.Default: true.
-
isAutoRows
public boolean isAutoRows()Returns whether enables the auto adjusting rows size.Default: true.
-
setFrozenCols
public void setFrozenCols(int fcols) Sets the size of the frozen columns.- Parameters:
fcols- the size of the frozen columns, it cannot be negative.
-
getFrozenCols
public int getFrozenCols()Returns the size of the frozen columns.Default: 0
-
setFixFrozenCols
public void setFixFrozenCols(boolean fixFrozenCols) Sets to fix the frozen columns, if true, meaning the user cannot change the size of the frozen columns dynamically. -
isFixFrozenCols
public boolean isFixFrozenCols()Returns whether is fix frozen columns, that means user cannot change the size of the frozen columns dynamically.Default: false
-
getSortAscending
Returns the ascending sorter provider, or null if not available. -
setSortAscending
Sets the ascending sorter provider, or null for no sorter for the ascending order.- Parameters:
sorter- the comparator provider used to return an sorter of the ascending order.
-
setSortAscending
public void setSortAscending(String clsnm) throws ClassNotFoundException, InstantiationException, IllegalAccessException Sets the ascending sorter provider with the class name, or null for no sorter for the ascending order. -
getSortDescending
Returns the descending sorter provider, or null if not available. -
setSortDescending
Sets the descending sorter provider, or null for no sorter for the descending order.- Parameters:
sorter- he comparator provider used to return an sorter of the descending order.
-
setSortDescending
public void setSortDescending(String clsnm) throws ClassNotFoundException, InstantiationException, IllegalAccessException Sets the descending sorter provider with the class name, or null for no sorter for the descending order. -
getOddRowSclass
Returns the style class for the odd rows.Default:
getZclass()-odd. -
setOddRowSclass
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. -
getPreloadSize
public int getPreloadSize()Returns the number of items to preload when receiving the rendering request from the client.Default: 50
-
getRows
public int getRows()Returns the rows' size of the viewport.Default: 30
-
setRows
public void setRows(int rows) Sets the rows' size of the viewport.Default: 30, and it will be adjusted by client engine according with the browser height.
-
getCols
public int getCols()Returns the number of columns within the viewport.Default: 30
-
setCols
public void setCols(int cols) Sets the number of columns within the viewport.Default: 30, and it will be adjusted by client engine according with the browser width.
-
getRowHeight
Returns the height of the single row.Default: 30px
-
setRowHeight
Sets the height of the single row.Default: 32px
-
getColWidth
Returns the width of the single columnDefault: 60px
-
setColWidth
Sets the width of the single column.Default: 60px
-
getModel
Returns the matrix model. -
setModel
Sets the matrix model.Note: the matrix model must implement
Selectableinterface -
onInitRender
public void onInitRender()Handles a private event, onInitRender. It is used only for implementation, and you rarely need to invoke it explicitly. -
getRealMatrixRenderer
Return the real matrix renderer, ifgetMatrixRenderer()is null, the default implementation is assumed. -
getMatrixRenderer
Returns the matrix renderer. -
setMatrixRenderer
Sets the matrix renderer. -
setMatrixRenderer
public void setMatrixRenderer(String clsnm) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException Sets the matrix renderer from a class string.- Parameters:
clsnm- the full package name- Throws:
ClassNotFoundExceptionNoSuchMethodExceptionIllegalAccessExceptionInstantiationExceptionInvocationTargetException
-
invalidate
public void invalidate()Description copied from interface:ComponentInvalidates this component by setting the dirty flag such that it will be redraw the whole content of this component and its dependencies later. And, the widget associated with this component and all its descendant at the client will be deleted and recreated, too.If the application is totally controlled by the server side (i.e., you don't write client codes), you rarely need to access this method.
It can be called only in the request-processing and event-processing phases. However, it is NOT allowed in the rendering phase.
- Specified by:
invalidatein interfaceComponent- Overrides:
invalidatein classAbstractComponent
-
isChildable
protected boolean isChildable()Description copied from class:AbstractComponentReturns whether this component can have a child.Default: return true (means it can have children).
- Overrides:
isChildablein classAbstractComponent
-
getSelectedIndex
public int getSelectedIndex()Returns the index of the selected item (-1 if no one is selected). -
getSelectedObject
Returns the selected object. -
renderProperties
Description copied from class:HtmlBasedComponentRenders the content of this component, excluding the enclosing tags and children.- Overrides:
renderPropertiesin classXulElement- Throws:
IOException
-
getZclass
The default zclass is "z-biglistbox"- Overrides:
getZclassin classHtmlBasedComponent- See Also:
-
service
Description copied from class:HtmlBasedComponentProcesses an AU request.Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.
- Specified by:
servicein interfaceComponentCtrl- Overrides:
servicein classHtmlBasedComponenteverError- whether any error ever occurred before processing this request.- See Also:
-
onSort
-
getSortableModel
Returns the sortable model, if any. -
sort
public boolean sort(boolean ascending, int columnIndex) -
sessionWillPassivate
Description copied from interface:ComponentCtrlNotification that the session, which owns this component, is about to be passivated (a.k.a., serialized).Note: only root components are notified by this method.
- Specified by:
sessionWillPassivatein interfaceComponentCtrl- Overrides:
sessionWillPassivatein classAbstractComponent
-
sessionDidActivate
Description copied from interface:ComponentCtrlNotification that the session, which owns this component, has just been activated (a.k.a., deserialized).Note: only root components are notified by this method.
- Specified by:
sessionDidActivatein interfaceComponentCtrl- Overrides:
sessionDidActivatein classAbstractComponent
-
onPageAttached
Description copied from class:AbstractComponentDefault: handles special event listeners.- Specified by:
onPageAttachedin interfaceComponentCtrl- Overrides:
onPageAttachedin classAbstractComponent- 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:
-
onPageDetached
Description copied from class:AbstractComponentDefault: handles special event listeners.- Specified by:
onPageDetachedin interfaceComponentCtrl- Overrides:
onPageDetachedin classAbstractComponent- Parameters:
page- the previous page (never null)- See Also:
-