Class sap.ui.commons.PaginatorModule: sap/ui/commons/Paginator

extends Control

Provides navigation between pages within a list of numbered pages.

Deprecated API:Since version 1.38.

Constructor Summary
new sap.ui.commons.Paginator(sId?, mSettings?)Constructor for a new Paginator.
Event Summary
page(oControlEvent)Event is fired when the user navigates to another page by selecting it directly, or by jumping forward/backward.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.Paginator.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.Paginator with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.Paginator.getMetadata()Returns a metadata object for class sap.ui.commons.Paginator.
attachPage(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the page event of this sap.ui.commons.Paginator.
detachPage(fnFunction, oListener)Detaches event handler fnFunction from the page event of this sap.ui.commons.Paginator.
firePage(mArguments?)Fires event page to attached listeners.
getCurrentPage()Gets current value of property currentPage.
getNumberOfPages()Gets current value of property numberOfPages.
setCurrentPage(iCurrentPage)Sets a new value for property currentPage.
setNumberOfPages(iNumberOfPages)Sets a new value for property numberOfPages.
Constructor Detail
new sap.ui.commons.Paginator(sId?, mSettings?)
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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Events
    • page : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
{string}sId? ID for the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Deprecated:
Since version 1.38.
Event Detail
page(oControlEvent)
Event is fired when the user navigates to another page by selecting it directly, or by jumping forward/backward.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{int}oControlEvent.getParameters.srcPage The page which is the current one before the page event is fired (and another page is displayed)
{int}oControlEvent.getParameters.targetPage 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.

{sap.ui.commons.PaginatorEvent}oControlEvent.getParameters.type 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
Method Detail
sap.ui.commons.Paginator.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.commons.Paginator.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.Paginator.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachPage(oData?, fnFunction, oListener?): sap.ui.commons.Paginator
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.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.commons.Paginator itself
Returns:
{sap.ui.commons.Paginator} Reference to this in order to allow method chaining
detachPage(fnFunction, oListener): sap.ui.commons.Paginator
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.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.commons.Paginator} Reference to this in order to allow method chaining
firePage(mArguments?): sap.ui.commons.Paginator
Fires event page to attached listeners.

Expects the following event parameters:

  • srcPage of type intThe page which is the current one before the page event is fired (and another page is displayed)
  • targetPage of type intThe 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 of type sap.ui.commons.PaginatorEventProvides 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
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.commons.Paginator} Reference to this in order to allow method chaining
getCurrentPage(): int
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.

Returns:
{int} Value of property currentPage
getNumberOfPages(): int
Gets current value of property numberOfPages.

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

Returns:
{int} Value of property numberOfPages
setCurrentPage(iCurrentPage): sap.ui.commons.Paginator
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.

Parameters:
{int}iCurrentPage New value for property currentPage
Returns:
{sap.ui.commons.Paginator} Reference to this in order to allow method chaining
setNumberOfPages(iNumberOfPages): sap.ui.commons.Paginator
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.

Parameters:
{int}iNumberOfPages New value for property numberOfPages
Returns:
{sap.ui.commons.Paginator} Reference to this in order to allow method chaining