Package org.zkoss.zkmax.zul
Class Biglistbox
- java.lang.Object
-
- org.zkoss.zk.ui.AbstractComponent
-
- org.zkoss.zk.ui.HtmlBasedComponent
-
- org.zkoss.zul.impl.XulElement
-
- org.zkoss.zkmax.zul.Biglistbox
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
public class Biglistbox extends org.zkoss.zul.impl.XulElementA component to handle a huge data sets and provides the same and as many as the functionalities ofListboxincluding 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
- org.zkoss.zkmax.zul.biglistbox.preloadSize
.- Specifies the number of items to preload when receiving the rendering request from the client.
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Biglistbox()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCols()Returns the number of columns within the viewport.java.lang.StringgetColWidth()Returns the width of the single columnintgetFrozenCols()Returns the size of the frozen columns.<T> MatrixRenderer<T>getMatrixRenderer()Returns the matrix renderer.MatrixModel<?,?,?,?>getModel()Returns the matrix model.java.lang.StringgetOddRowSclass()Returns the style class for the odd rows.intgetPreloadSize()Returns the number of items to preload when receiving the rendering request from the client.<T> MatrixRenderer<T>getRealMatrixRenderer()Return the real matrix renderer, ifgetMatrixRenderer()is null, the default implementation is assumed.java.lang.StringgetRowHeight()Returns the height of the single row.intgetRows()Returns the rows' size of the viewport.intgetSelectedIndex()Returns the index of the selected item (-1 if no one is selected).java.lang.ObjectgetSelectedObject()Returns the selected object.org.zkoss.zul.ext.SortablegetSortableModel()Returns the sortable model, if any.MatrixComparatorProvider<?>getSortAscending()Returns the ascending sorter provider, or null if not available.MatrixComparatorProvider<?>getSortDescending()Returns the descending sorter provider, or null if not available.java.lang.StringgetZclass()The default zclass is "z-biglistbox"voidinvalidate()booleanisAutoCols()Returns whether enables the auto adjusting cols size.booleanisAutoRows()Returns whether enables the auto adjusting rows size.protected booleanisChildable()booleanisFixFrozenCols()Returns whether is fix frozen columns, that means user cannot change the size of the frozen columns dynamically.voidonInitRender()Handles a private event, onInitRender.voidonPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)voidonPageDetached(org.zkoss.zk.ui.Page page)voidonSort(SortEventExt event)protected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)voidservice(org.zkoss.zk.au.AuRequest request, boolean everError)voidsessionDidActivate(org.zkoss.zk.ui.Page page)voidsessionWillPassivate(org.zkoss.zk.ui.Page page)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(java.lang.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(java.lang.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(java.lang.String scls)Sets the style class for the odd rows.voidsetRowHeight(java.lang.String rowHeight)Sets the height of the single row.voidsetRows(int rows)Sets the rows' size of the viewport.voidsetSortAscending(java.lang.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(java.lang.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, setTooltipAttributes
-
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, 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, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
-
Methods 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, 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, 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
-
-
-
-
Method Detail
-
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
public MatrixComparatorProvider<?> getSortAscending()
Returns the ascending sorter provider, or null if not available.
-
setSortAscending
public void setSortAscending(MatrixComparatorProvider<?> sorter)
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(java.lang.String clsnm) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessExceptionSets the ascending sorter provider with the class name, or null for no sorter for the ascending order.- Throws:
java.lang.ClassNotFoundExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessException
-
getSortDescending
public MatrixComparatorProvider<?> getSortDescending()
Returns the descending sorter provider, or null if not available.
-
setSortDescending
public void setSortDescending(MatrixComparatorProvider<?> sorter)
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(java.lang.String clsnm) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessExceptionSets the descending sorter provider with the class name, or null for no sorter for the descending order.- Throws:
java.lang.ClassNotFoundExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessException
-
getOddRowSclass
public java.lang.String getOddRowSclass()
Returns the style class for the odd rows.Default:
getZclass()-odd.
-
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.
-
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
public java.lang.String getRowHeight()
Returns the height of the single row.Default: 30px
-
setRowHeight
public void setRowHeight(java.lang.String rowHeight)
Sets the height of the single row.Default: 32px
-
getColWidth
public java.lang.String getColWidth()
Returns the width of the single columnDefault: 60px
-
setColWidth
public void setColWidth(java.lang.String colWidth)
Sets the width of the single column.Default: 60px
-
getModel
public MatrixModel<?,?,?,?> getModel()
Returns the matrix model.
-
setModel
public void setModel(MatrixModel<?,?,?,?> model)
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
public <T> MatrixRenderer<T> getRealMatrixRenderer()
Return the real matrix renderer, ifgetMatrixRenderer()is null, the default implementation is assumed.
-
getMatrixRenderer
public <T> MatrixRenderer<T> getMatrixRenderer()
Returns the matrix renderer.
-
setMatrixRenderer
public void setMatrixRenderer(MatrixRenderer<?> renderer)
Sets the matrix renderer.
-
setMatrixRenderer
public void setMatrixRenderer(java.lang.String clsnm) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSets the matrix renderer from a class string.- Parameters:
clsnm- the full package name- Throws:
java.lang.ClassNotFoundExceptionjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
invalidate
public void invalidate()
- Specified by:
invalidatein interfaceorg.zkoss.zk.ui.Component- Overrides:
invalidatein classorg.zkoss.zk.ui.AbstractComponent
-
isChildable
protected boolean isChildable()
- Overrides:
isChildablein classorg.zkoss.zk.ui.AbstractComponent
-
getSelectedIndex
public int getSelectedIndex()
Returns the index of the selected item (-1 if no one is selected).
-
getSelectedObject
public java.lang.Object getSelectedObject()
Returns the selected object.
-
renderProperties
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException- Overrides:
renderPropertiesin classorg.zkoss.zul.impl.XulElement- Throws:
java.io.IOException
-
getZclass
public java.lang.String getZclass()
The default zclass is "z-biglistbox"- Overrides:
getZclassin classorg.zkoss.zk.ui.HtmlBasedComponent
-
service
public void service(org.zkoss.zk.au.AuRequest request, boolean everError)- Specified by:
servicein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
servicein classorg.zkoss.zk.ui.HtmlBasedComponent
-
onSort
public void onSort(SortEventExt event)
-
getSortableModel
public org.zkoss.zul.ext.Sortable getSortableModel()
Returns the sortable model, if any.
-
sort
public boolean sort(boolean ascending, int columnIndex)
-
sessionWillPassivate
public void sessionWillPassivate(org.zkoss.zk.ui.Page page)
- Specified by:
sessionWillPassivatein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
sessionWillPassivatein classorg.zkoss.zk.ui.AbstractComponent
-
sessionDidActivate
public void sessionDidActivate(org.zkoss.zk.ui.Page page)
- Specified by:
sessionDidActivatein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
sessionDidActivatein classorg.zkoss.zk.ui.AbstractComponent
-
onPageAttached
public void onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)- Specified by:
onPageAttachedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onPageAttachedin classorg.zkoss.zk.ui.AbstractComponent
-
onPageDetached
public void onPageDetached(org.zkoss.zk.ui.Page page)
- Specified by:
onPageDetachedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onPageDetachedin classorg.zkoss.zk.ui.AbstractComponent
-
-