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>
ImmutablePagingcomponentA 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,gridandtreecomponents support thepagingintrinsically, so you don't need to specify apagingcomponent explicitly. In other words, they will instantiate and manage apagingcomponent automatically if thepagingmold is specified. Of course, you could specify an external paging component, if you want to have different visual layout, or to control multiplelistboxes,gridsand/ortreeswith one singlepagingcomponent.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 classIPaging.BuilderBuilds instances of typeIPaging.static classIPaging.UpdaterBuilds an updater of typeIPagingforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intgetActivePage()Returns the active page (starting from 0).default intgetPageCount()Returns the number of pages.default intgetPageIncrement()Returns the number of page anchors shall appear at the client.default intgetPageSize()Returns the number of items per page.default intgetTotalSize()Returns the total number of items.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisAutohide()Returns whether to automatically hide the paging if there is only one page available.default booleanisDetailed()Returns whether to show the detailed info, such asgetTotalSize()static IPagingofId(java.lang.String id)Returns the instance with the given id.static IPagingofTotalSize(int totalSize)Returns the instance with the given total size.IPagingwithActivePage(int activePage)Returns a copy ofthisimmutable component with the specifiedactivePage.IPagingwithAutohide(boolean autohide)Returns a copy ofthisimmutable component with the specifiedautohide.IPagingwithDetailed(boolean detailed)Returns a copy ofthisimmutable component with the specifieddetailed.IPagingwithPageCount(int pageCount)Returns a copy ofthisimmutable component with the specifiedpageCount.IPagingwithPageIncrement(int pageIncrement)Returns a copy ofthisimmutable component with the specifiedpageIncrement.IPagingwithPageSize(int pageSize)Returns a copy ofthisimmutable component with the specifiedpageSize.IPagingwithTotalSize(int totalSize)Returns a copy ofthisimmutable 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:
getWidgetClassin interfaceIComponent<IPaging>
-
getPageSize
default int getPageSize()
Returns the number of items per page.Default:
20.
-
withPageSize
IPaging withPageSize(int pageSize)
Returns a copy ofthisimmutable 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
thisobject
-
getTotalSize
default int getTotalSize()
Returns the total number of items.Default:
0
-
withTotalSize
IPaging withTotalSize(int totalSize)
Returns a copy ofthisimmutable component with the specifiedtotalSize.To specify the total size of the
pagingcomponent- Parameters:
totalSize- The total size of thepagingcomponent. (non-negative only)Default:
0- Returns:
- A modified copy of the
thisobject
-
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 ofthisimmutable 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
thisobject
-
isDetailed
default boolean isDetailed()
Returns whether to show the detailed info, such asgetTotalSize()Default:
false
-
withDetailed
IPaging withDetailed(boolean detailed)
Returns a copy ofthisimmutable component with the specifieddetailed.Sets whether to show total size and index of items in current page
- Parameters:
detailed-trueif enables the detail information.Default:
false- Returns:
- A modified copy of the
thisobject
-
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 ofthisimmutable component with the specifiedautohide.Sets whether to automatically hide the
pagingcomponent at client if there is only one page available.- Parameters:
autohide-trueif enables the auto-hide feature.Default:
false- Returns:
- A modified copy of the
thisobject
-
getActivePage
default int getActivePage()
Returns the active page (starting from 0).Default:
0
-
withActivePage
IPaging withActivePage(int activePage)
Returns a copy ofthisimmutable 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 from1for human to see.- Parameters:
activePage- The active page to display at client.Default:
0- Returns:
- A modified copy of the
thisobject
-
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 ofthisimmutable component with the specifiedpageIncrement.Sets the number of page list icon when the
moldis"os"- Parameters:
pageIncrement- The number of page list icon when themoldis"os"(Non-positive only)Default:
10.- Returns:
- A modified copy of the
thisobject
-
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
-
-