org.zkoss.zul
Class Paging

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.Paging
All Implemented Interfaces:
Serializable, Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.sys.ComponentCtrl, Pageable, Paginal

public class Paging
extends XulElement
implements Paginal

Paging of long content.

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

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
 
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
Paging()
           
Paging(int totalsz, int pagesz)
          Constructor.
 
Method Summary
 int getActivePage()
          Returns the active page (starting from 0).
 int getPageCount()
          Returns the number of pages.
 int getPageIncrement()
          Returns the number of page anchors shall appear at the client.
 int getPageSize()
          Returns the number of items per page.
 int getTotalSize()
          Returns the total number of items.
 String getZclass()
           
 boolean isAutohide()
          Returns whether to automatically hide this component if there is only one page available.
protected  boolean isChildable()
           
 boolean isDetailed()
          Returns whether to show the detailed info, such as Paginal.getTotalSize().
 boolean isVisible()
           
protected  void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
           
 void service(org.zkoss.zk.au.AuRequest request, boolean everError)
          Processes an AU request.
 void setActivePage(int pg)
          Set the active page Note: In server side, active page starts from 0.
 void setAutohide(boolean autohide)
          Sets whether to automatically hide this component if there is only one page available.
 void setDetailed(boolean detailed)
          Sets whether to show total size and index of items in current page
 void setPageIncrement(int pginc)
          Sets the number of page list icon when mold is "os"
 void setPageSize(int size)
          Sets the items to show in each page
 void setTotalSize(int size)
          Sets total size of items
 
Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, 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.ext.Paginal
addEventListener, removeEventListener
 

Constructor Detail

Paging

public Paging()

Paging

public Paging(int totalsz,
              int pagesz)
Constructor.

Parameters:
totalsz - the total # of items
pagesz - the # of items per page
Method Detail

getPageSize

public int getPageSize()
Description copied from interface: Pageable
Returns the number of items per page.

Default: 20.

Specified by:
getPageSize in interface Pageable

setPageSize

public void setPageSize(int size)
                 throws org.zkoss.zk.ui.WrongValueException
Sets the items to show in each page

Specified by:
setPageSize in interface Pageable
Throws:
org.zkoss.zk.ui.WrongValueException

getTotalSize

public int getTotalSize()
Description copied from interface: Paginal
Returns the total number of items.

Specified by:
getTotalSize in interface Paginal

setTotalSize

public void setTotalSize(int size)
                  throws org.zkoss.zk.ui.WrongValueException
Sets total size of items

Specified by:
setTotalSize in interface Paginal
Throws:
org.zkoss.zk.ui.WrongValueException

getPageCount

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

Specified by:
getPageCount in interface Pageable

getActivePage

public int getActivePage()
Description copied from interface: Pageable
Returns the active page (starting from 0).

Specified by:
getActivePage in interface Pageable

setActivePage

public void setActivePage(int pg)
                   throws org.zkoss.zk.ui.WrongValueException
Set the active page

Note: In server side, active page starts from 0. But in browser UI, it starts from 1

Specified by:
setActivePage in interface Pageable
Throws:
org.zkoss.zk.ui.WrongValueException

getPageIncrement

public int getPageIncrement()
Description copied from interface: Paginal
Returns the number of page anchors shall appear at the client.

Default: 10.

Specified by:
getPageIncrement in interface Paginal

setPageIncrement

public void setPageIncrement(int pginc)
                      throws org.zkoss.zk.ui.WrongValueException
Sets the number of page list icon when mold is "os"

Specified by:
setPageIncrement in interface Paginal
Throws:
org.zkoss.zk.ui.WrongValueException

isDetailed

public boolean isDetailed()
Description copied from interface: Paginal
Returns whether to show the detailed info, such as Paginal.getTotalSize().

Specified by:
isDetailed in interface Paginal

setDetailed

public void setDetailed(boolean detailed)
Sets whether to show total size and index of items in current page

Specified by:
setDetailed in interface Paginal

isAutohide

public boolean isAutohide()
Returns whether to automatically hide this component if there is only one page available.

Default: false.


setAutohide

public void setAutohide(boolean autohide)
Sets whether to automatically hide this component if there is only one page available.


renderProperties

protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
                         throws IOException
Overrides:
renderProperties in class XulElement
Throws:
IOException

getZclass

public String getZclass()
Overrides:
getZclass in class org.zkoss.zk.ui.HtmlBasedComponent

isVisible

public boolean isVisible()
Specified by:
isVisible in interface org.zkoss.zk.ui.Component
Overrides:
isVisible in class org.zkoss.zk.ui.AbstractComponent

isChildable

protected boolean isChildable()
Overrides:
isChildable in class org.zkoss.zk.ui.AbstractComponent

service

public void service(org.zkoss.zk.au.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 org.zkoss.zk.ui.sys.ComponentCtrl
Overrides:
service in class org.zkoss.zk.ui.HtmlBasedComponent
Since:
5.0.0


Copyright © 2013. All rights reserved.