class sap.ui.commons.Paginator

Control sample: sap.ui.commons.Paginator
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/commons/Paginator
Application Component: CA-UI5-CTR

Provides navigation between pages within a list of numbered pages.


Constructor

Constructor for a new Paginator.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.commons.Paginator(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

Initial settings for the new control


Properties

Name Type Default Value Description
currentPage int 1

Represents the current page (first page has index 1, not 0, to match the visual number)

Visibility: public
numberOfPages int

Represents the overall number of pages that are embedded into the parent control

Visibility: public

Events Overview

Event Description
page

Event is fired when the user navigates to another page by selecting it directly, or by jumping forward/backward.

page

Event is fired when the user navigates to another page by selecting it directly, or by jumping forward/backward.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
srcPage int

The page which is the current one before the page event is fired (and another page is displayed)

targetPage int

The page that shall be displayed next after the page event is fired.

The page number is 1-based: the first page has index 1, not 0, to match the number visible in the UI.

type sap.ui.commons.PaginatorEvent

Provides the values 'First', 'Last', 'Next', 'Previous', 'Goto'. The event parameter informs the application how the user navigated to the new page: Whether the 'Next' button was used, or another button, or whether the page was directly selected


Methods Overview

Method Description
attachPage

Attaches event handler fnFunction to the page event of this sap.ui.commons.Paginator.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.commons.Paginator itself.

Event is fired when the user navigates to another page by selecting it directly, or by jumping forward/backward.

detachPage

Detaches event handler fnFunction from the page event of this sap.ui.commons.Paginator.

The passed function and listener object must match the ones used for event registration.

sap.ui.commons.Paginator.extend

Creates a new subclass of class sap.ui.commons.Paginator with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

firePage

Fires event page to attached listeners.

getCurrentPage

Gets current value of property currentPage.

Represents the current page (first page has index 1, not 0, to match the visual number)

Default value is 1.

sap.ui.commons.Paginator.getMetadata

Returns a metadata object for class sap.ui.commons.Paginator.

getNumberOfPages

Gets current value of property numberOfPages.

Represents the overall number of pages that are embedded into the parent control

setCurrentPage

Sets a new value for property currentPage.

Represents the current page (first page has index 1, not 0, to match the visual number)

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 1.

setNumberOfPages

Sets a new value for property numberOfPages.

Represents the overall number of pages that are embedded into the parent control

When called with a value of null or undefined, the default value of the property will be restored.

attachPage

Attaches event handler fnFunction to the page event of this sap.ui.commons.Paginator.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.commons.Paginator itself.

Event is fired when the user navigates to another page by selecting it directly, or by jumping forward/backward.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.commons.Paginator itself

detachPage

Detaches event handler fnFunction from the page event of this sap.ui.commons.Paginator.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.commons.Paginator.extend

Creates a new subclass of class sap.ui.commons.Paginator with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

firePage

Fires event page to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

srcPage int

The page which is the current one before the page event is fired (and another page is displayed)

targetPage int

The page that shall be displayed next after the page event is fired.

The page number is 1-based: the first page has index 1, not 0, to match the number visible in the UI.

type sap.ui.commons.PaginatorEvent

Provides the values 'First', 'Last', 'Next', 'Previous', 'Goto'. The event parameter informs the application how the user navigated to the new page: Whether the 'Next' button was used, or another button, or whether the page was directly selected

getCurrentPage

Gets current value of property currentPage.

Represents the current page (first page has index 1, not 0, to match the visual number)

Default value is 1.

sap.ui.commons.Paginator.getMetadata

Returns a metadata object for class sap.ui.commons.Paginator.

getNumberOfPages

Gets current value of property numberOfPages.

Represents the overall number of pages that are embedded into the parent control

setCurrentPage

Sets a new value for property currentPage.

Represents the current page (first page has index 1, not 0, to match the visual number)

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 1.

Param Type DefaultValue Description
iCurrentPage int 1

New value for property currentPage

setNumberOfPages

Sets a new value for property numberOfPages.

Represents the overall number of pages that are embedded into the parent control

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
iNumberOfPages int

New value for property numberOfPages