|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Paging
public class Paging
Paging of long content.
Default getZclass(): z-paging. (since 3.5.0)
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
HtmlBasedComponent.ExtraCtrl |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
_zclass, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| 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 |
| Constructor Summary | |
|---|---|
Paging()
|
|
Paging(int totalsz,
int pagesz)
Contructor. |
|
| Method Summary | |
|---|---|
int |
getActivePage()
Returns the active page (starting from 0). |
java.lang.String |
getInfoTags()
Returns the HTML tags of paging information. |
java.lang.String |
getInnerTags()
Returns the inner HTML tags of this component. |
java.lang.String |
getOuterAttrs()
Returns the exterior attributes for generating the enclosing HTML tag; never return null. |
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. |
java.lang.String |
getZclass()
Returns the ZK Cascading Style class(es) for this component. |
void |
invalidate()
Invalidates this component by setting the dirty flag such that it will be redraw the whole content later. |
protected void |
invalidateWholeIfAny()
|
boolean |
isAutohide()
Returns whether to automatically hide this component if there is only one page available. |
boolean |
isChildable()
Default: return true (allows to have children). |
boolean |
isDetailed()
Returns whether to show the detailed info, such as Paginal.getTotalSize(). |
boolean |
isVisible()
Returns whether this component is visible. |
void |
setActivePage(int pg)
Sets the active page (starting 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 the detailed info, such as Paginal.getTotalSize(). |
void |
setPageIncrement(int pginc)
Sets the number of page anchors shall appear at the client. |
void |
setPageSize(int size)
Sets the number of items per page. |
void |
setTotalSize(int size)
Sets the total number of items. |
void |
smartUpdate(java.lang.String attr,
boolean value)
A special smart-update that update a value in boolean. |
void |
smartUpdate(java.lang.String attr,
int value)
A special smart-update that update a value in int. |
void |
smartUpdate(java.lang.String attr,
java.lang.String value)
Smart-updates a property with the specified value. |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, newExtraCtrl, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| 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, clone, containsVariable, detach, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, isInvalidated, isListenerAvailable, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, unsetVariable |
| Methods inherited from interface org.zkoss.zul.ext.Paginal |
|---|
addEventListener, removeEventListener |
| Constructor Detail |
|---|
public Paging()
public Paging(int totalsz,
int pagesz)
totalsz - the total # of itemspagesz - the # of items per page| Method Detail |
|---|
public void smartUpdate(java.lang.String attr,
java.lang.String value)
ComponentCtrlThe 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 Component.invalidate() is ever invoked
(in the same execution), since Component.invalidate() assumes
the whole content shall be redrawn and all smart updates to
this components can be ignored,
Once this method is called, all invocations to ComponentCtrl.smartUpdate(java.lang.String, java.lang.String)
will then be ignored, and Component.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 ComponentCtrl.smartUpdate(java.lang.String, java.lang.String).
While Component.invalidate() causes the whole content to redraw,
ComponentCtrl.smartUpdate(java.lang.String, java.lang.String) let component developer control which part
to redraw.
smartUpdate in interface ComponentCtrlsmartUpdate in class AbstractComponentvalue - the new value. If null, it means removing the property.ComponentCtrl.smartUpdateDeferred(java.lang.String, org.zkoss.zk.ui.util.DeferredValue),
ComponentCtrl.smartUpdateValues(java.lang.String, java.lang.Object[])
public void smartUpdate(java.lang.String attr,
int value)
AbstractComponentIt will invoke AbstractComponent.smartUpdate(String,String) to update
the attribute eventually.
smartUpdate in class AbstractComponent
public void smartUpdate(java.lang.String attr,
boolean value)
AbstractComponentIt will invoke AbstractComponent.smartUpdate(String,String) to update
the attribute eventually.
smartUpdate in class AbstractComponentpublic void invalidate()
ComponentIt can be called only in the request-processing and event-processing phases; excluding the redrawing phase.
invalidate in interface Componentinvalidate in class AbstractComponentprotected void invalidateWholeIfAny()
public int getPageSize()
PageableDefault: 20.
getPageSize in interface Pageable
public void setPageSize(int size)
throws WrongValueException
Pageable
setPageSize in interface PageableWrongValueExceptionpublic int getTotalSize()
Paginal
getTotalSize in interface Paginal
public void setTotalSize(int size)
throws WrongValueException
Paginal
setTotalSize in interface PaginalWrongValueExceptionpublic int getPageCount()
Pageable
getPageCount in interface Pageablepublic int getActivePage()
Pageable
getActivePage in interface Pageable
public void setActivePage(int pg)
throws WrongValueException
Pageable
setActivePage in interface PageableWrongValueExceptionpublic int getPageIncrement()
PaginalDefault: 10.
getPageIncrement in interface Paginal
public void setPageIncrement(int pginc)
throws WrongValueException
Paginal
setPageIncrement in interface PaginalWrongValueExceptionpublic boolean isDetailed()
PaginalPaginal.getTotalSize().
isDetailed in interface Paginalpublic void setDetailed(boolean detailed)
PaginalPaginal.getTotalSize().
setDetailed in interface Paginalpublic boolean isAutohide()
Default: false.
isAutohide in interface Pagingpublic void setAutohide(boolean autohide)
setAutohide in interface Pagingpublic java.lang.String getInfoTags()
Default: active-page-number / total-numbers-of-pages
Developers can override this method to show different information.
public java.lang.String getInnerTags()
Used only for component development. Not accessible by application developers.
public java.lang.String getZclass()
HtmlBasedComponentDefault: 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.
getZclass in interface HtmlBasedComponentgetZclass in class HtmlBasedComponentHtmlBasedComponent.getSclass(),
HtmlBasedComponent.getRealSclass()public java.lang.String getOuterAttrs()
HtmlBasedComponentUsed only by component developers.
Default: Generates the tooltip text, style, sclass, draggable
and droppable attribute if necessary.
In other words, the corresponding attribute is generated if
HtmlBasedComponent.getTooltiptext(), HtmlBasedComponent.getRealStyle(),
HtmlBasedComponent.getSclass(), HtmlBasedComponent.getDraggable(), HtmlBasedComponent.getDroppable()
are defined.
You have to call both HtmlBasedComponent.getOuterAttrs() and
HtmlBasedComponent.getInnerAttrs() to generate complete attributes.
For simple components that all attributes are put on the outest HTML element, all you need is as follows.
<xx id="${self.uuid}"${self.outerAttrs}${self.innerAttrs}>
If you want to put attributes in a nested HTML element, you
shall use the following pattern. Notice: if HtmlBasedComponent.getInnerAttrs()
in a different tag, the tag must be named with "${self.uuid}!real".
<xx id="${self.uuid}"${self.outerAttrs}>
<yy id="${self.uuid}!real"${self.innerAttrs}>...
Note: This class handles non-deferrable event listeners automatically.
However, you have to invoke AbstractComponent.appendAsapAttr(java.lang.StringBuffer, java.lang.String) for each event
the component handles in HtmlBasedComponent.getOuterAttrs() as follows.
appendAsapAttr(sb, Events.ON_OPEN);
appendAsapAttr(sb, Events.ON_CHANGE);
Theorectically, you could put any attributes in either
HtmlBasedComponent.getInnerAttrs() or HtmlBasedComponent.getOuterAttrs().
However, zkau.js assumes all attributes are put at the outer one.
If you want something different, you have to provide your own
setAttr (refer to how checkbox is implemented).
getOuterAttrs in class XulElementpublic boolean isVisible()
Component
isVisible in interface ComponentisVisible in class AbstractComponentComponents.isRealVisible(org.zkoss.zk.ui.Component)public boolean isChildable()
AbstractComponent
isChildable in interface ComponentisChildable in class AbstractComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||