Interface IPaging
-
- All Superinterfaces:
IAnyGroup<IPaging>
,IComponent<IPaging>
,IDisable<IPaging>
,IHtmlBasedComponent<IPaging>
,IMeshComposite<IPaging>
,IXulElement<IPaging>
public interface IPaging extends IXulElement<IPaging>, IDisable<IPaging>, IMeshComposite<IPaging>, IAnyGroup<IPaging>
ImmutablePaging
componentA paging component is used with another component to separate long content into multiple pages. If a component has long content to display, you could separate them into pages, and then use a paging component as a controller to allow the user decide which page to display.
The
listbox
,grid
andtree
components support thepaging
intrinsically, so you don't need to specify apaging
component explicitly. In other words, they will instantiate and manage apaging
component automatically if thepaging
mold is specified. Of course, you could specify an external paging component, if you want to have different visual layout, or to control multiplelistboxes
,grids
and/ortrees
with one singlepaging
component.Support @Action
Name Action Type onPaging ActionData: PagingData
Represents an action triggered by the user navigates a new page.Support Molds
Name Snapshot "default"
"os"
For example, suppose you have 100 items and prefer to show 20 items at a time, then you can use the paging components as follows.@
RichletMapping
("") public IComponent index() { return IVlayout.of(IPaging.ofTotalSize(100)); }- Author:
- jumperchen
- See Also:
Paging
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IPaging.Builder
Builds instances of typeIPaging
.static class
IPaging.Updater
Builds an updater of typeIPaging
forUiAgent.smartUpdate(Locator, SmartUpdater)
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
getActivePage()
Returns the active page (starting from 0).default int
getPageCount()
Returns the number of pages.default int
getPageIncrement()
Returns the number of page anchors shall appear at the client.default int
getPageSize()
Returns the number of items per page.default int
getTotalSize()
Returns the total number of items.default java.lang.String
getWidgetClass()
Returns the client widget class.default boolean
isAutohide()
Returns whether to automatically hide the paging if there is only one page available.default boolean
isDetailed()
Returns whether to show the detailed info, such asgetTotalSize()
static IPaging
ofId(java.lang.String id)
Returns the instance with the given id.static IPaging
ofTotalSize(int totalSize)
Returns the instance with the given total size.IPaging
withActivePage(int activePage)
Returns a copy ofthis
immutable component with the specifiedactivePage
.IPaging
withAutohide(boolean autohide)
Returns a copy ofthis
immutable component with the specifiedautohide
.IPaging
withDetailed(boolean detailed)
Returns a copy ofthis
immutable component with the specifieddetailed
.IPaging
withPageCount(int pageCount)
Returns a copy ofthis
immutable component with the specifiedpageCount
.IPaging
withPageIncrement(int pageIncrement)
Returns a copy ofthis
immutable component with the specifiedpageIncrement
.IPaging
withPageSize(int pageSize)
Returns a copy ofthis
immutable component with the specifiedpageSize
.IPaging
withTotalSize(int totalSize)
Returns a copy ofthis
immutable component with the specifiedtotalSize
.-
Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IDisable
isDisabled, withDisabled
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final IPaging DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zul.mess.Paging"
- Specified by:
getWidgetClass
in interfaceIComponent<IPaging>
-
getPageSize
default int getPageSize()
Returns the number of items per page.Default:
20
.
-
withPageSize
IPaging withPageSize(int pageSize)
Returns a copy ofthis
immutable component with the specifiedpageSize
.Sets the items to show in each page
- Parameters:
pageSize
- The number of items per page. (positive only)Default:
20
.- Returns:
- A modified copy of the
this
object
-
getTotalSize
default int getTotalSize()
Returns the total number of items.Default:
0
-
withTotalSize
IPaging withTotalSize(int totalSize)
Returns a copy ofthis
immutable component with the specifiedtotalSize
.To specify the total size of the
paging
component- Parameters:
totalSize
- The total size of thepaging
component. (non-negative only)Default:
0
- Returns:
- A modified copy of the
this
object
-
getPageCount
default int getPageCount()
Returns the number of pages.Note: there is at least one page even no item at all.
Default:
1
-
withPageCount
IPaging withPageCount(int pageCount)
Returns a copy ofthis
immutable component with the specifiedpageCount
.Sets the number of pages
Note: there is at least one page even no item at all.
- Parameters:
pageCount
- The number of pages.Default:
1
- Returns:
- A modified copy of the
this
object
-
isDetailed
default boolean isDetailed()
Returns whether to show the detailed info, such asgetTotalSize()
Default:
false
-
withDetailed
IPaging withDetailed(boolean detailed)
Returns a copy ofthis
immutable component with the specifieddetailed
.Sets whether to show total size and index of items in current page
- Parameters:
detailed
-true
if enables the detail information.Default:
false
- Returns:
- A modified copy of the
this
object
-
isAutohide
default boolean isAutohide()
Returns whether to automatically hide the paging if there is only one page available.Default:
false
-
withAutohide
IPaging withAutohide(boolean autohide)
Returns a copy ofthis
immutable component with the specifiedautohide
.Sets whether to automatically hide the
paging
component at client if there is only one page available.- Parameters:
autohide
-true
if enables the auto-hide feature.Default:
false
- Returns:
- A modified copy of the
this
object
-
getActivePage
default int getActivePage()
Returns the active page (starting from 0).Default:
0
-
withActivePage
IPaging withActivePage(int activePage)
Returns a copy ofthis
immutable component with the specifiedactivePage
.Sets the active page (starting from 0)
Note: In server side, the active page starts from
0
. But in browser UI, it starts from1
for human to see.- Parameters:
activePage
- The active page to display at client.Default:
0
- Returns:
- A modified copy of the
this
object
-
getPageIncrement
default int getPageIncrement()
Returns the number of page anchors shall appear at the client.Default:
10
.
-
withPageIncrement
IPaging withPageIncrement(int pageIncrement)
Returns a copy ofthis
immutable component with the specifiedpageIncrement
.Sets the number of page list icon when the
mold
is"os"
- Parameters:
pageIncrement
- The number of page list icon when themold
is"os"
(Non-positive only)Default:
10
.- Returns:
- A modified copy of the
this
object
-
ofTotalSize
static IPaging ofTotalSize(int totalSize)
Returns the instance with the given total size.- Parameters:
totalSize
- The total size of this paging component.
-
ofId
static IPaging ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id
- The id to identify this component
-
-