Paging

A paging component is used to separate long content into multiple pages. For example, assume that you have 100 items and prefer to show 20 items at a time, then you can use the paging components as follows.

Then, when a user clicks on the hyperlinks, the onPaging event is sent with an instance of org.zkoss.zul.event.PagingEvent to the paging component. To decide which portion of your 100 items are visible, you shall add a listener to the paging component.

<vbox>
<paging totalSize="100" pageSize="20"/>
</vbox>

The listbox and grid component support the paging intrinsically, so you don't need to specify a paging component explicitly as above, unless you want to have different visual layout or to control multiple listbox and grid with one paging component.

Class Name

org.zkoss.zul.Paging

Supported Child Components

*NONE

Supported Events

Name

Event Type

onPaging

org.zkoss.zk.ui.event.PagingEvent

Description: Notifies one of the pages of a multi-page component is selected by the user.

Properties

Property

Description

Data Type

Default Value

activePage

Sets the active page (starting from 0).

int

0

aut ohide

Sets whether to automatically hide this component if there is only one page available.

boolean

false

det ailed

Sets whether to show the detailed info, such as Paginal.getTotalSize().

boolean

false

pageIncrement

Sets the number of page anchors shall appear at the client.

int

10

pageSize

Sets the number of items per page.

int

20

totalSize

Sets the total number of items.

int

0

Methods

Name

Description

Return Data Type

getPageCount

Returns the number of pages

int

getInnerTags

Returns the inner HTML tags of this component.

String

Inherited From