Element: <oj-paging-control>

Oracle® JavaScript Extension Toolkit (JET)
4.2.0

E91398-01

QuickNav

Attributes

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Version:
  • 4.2.0

JET Custom Elements

JET components are implemented as custom HTML elements. A detailed description of working with these elements can be found in: JET Custom Element Usage.

JET PagingControl

Description:

A JET PagingControl provides paging functionality.

<oj-paging-control
  data='{{pagingModel}}'
  page-size='10'>
</oj-paging-control>

Keyboard End User Information

Target Key Action
Page Number Input Tab In Set focus to the input.
Arrow Page Navigation Tab Set focus to the first, previous, next, or last page arrow.
Numbered Page Links Tab Set focus to to the page link.

Touch End User Information

Target Gesture Action
Page Navigation Bar Swipe When mode='page', swiping left or right on the page navigation bar will either increment or decrement the page respectively.
Page Number Input Tap Set focus to the input.
Arrow Page Navigation Tap Navigates to the first, previous, next, or last page.
Numbered Page Links Tap Navigates to the page.

Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.

Slots

JET elements can have up to two types of child content:

  • Any child element with a slot attribute will be moved into that named slot, e.g. <span slot='startIcon'>...</span>. All supported named slots are documented below. Child elements with unsupported named slots will be removed from the DOM.
  • Any child element lacking a slot attribute will be moved to the default slot, also known as a regular child.

contextMenu

The contextMenu slot is set on the oj-menu within this element. This is used to designate the JET Menu that this component should launch as a context menu on right-click, Shift-F10, Press & Hold, or component-specific gesture. If specified, the browser's native context menu will be replaced by the JET Menu specified in this slot.

The application can register a listener for the Menu's ojBeforeOpen event. The listener can cancel the launch via event.preventDefault(), or it can customize the menu contents by editing the menu DOM directly, and then calling refresh() on the Menu.

To help determine whether it's appropriate to cancel the launch or customize the menu, the ojBeforeOpen listener can use component API's to determine which table cell, chart item, etc., is the target of the context menu. See the JSDoc and demos of the individual components for details.

Keep in mind that any such logic must work whether the context menu was launched via right-click, Shift-F10, Press & Hold, or component-specific touch gesture.

Example

Initialize the component with a context menu:

<oj-some-element>
    <-- use the contextMenu slot to designate this as the context menu for this component -->
    <oj-menu slot="contextMenu" style="display:none" aria-label="Some element's context menu">
...
    </oj-menu>
</oj-some-element>

Attributes

data :oj.PagingModel

The data to bind to the PagingControl.

Must implement the oj.PagingModel interface oj.PagingModel

Default Value:
  • null
Names
Item Name
Property data
Property change event dataChanged
Property change listener attribute (must be of type function) on-data-changed
Examples

Initialize the PagingControl with the data attribute specified:

<oj-paging-control data='{{pagingDataSource}}'></oj-paging-control>

Get or set the data property after initialization:

// getter
var pagingDataSource = myPagingControl.data;

// setter
myPagingControl.data = pagingDataSource;

load-more-options :Object.<string, number>

Options for loadMore mode.
Default Value:
  • {"maxCount": 500}
Names
Item Name
Property loadMoreOptions
Property change event loadMoreOptionsChanged
Property change listener attribute (must be of type function) on-load-more-options-changed
Examples

Initialize the PagingControl, overriding load-more-options value:

<!-- Using dot notation -->
<oj-paging-control load-more-options.max-count='300'></oj-paging-control>

<!-- Using JSON notation -->
<oj-paging-control load-more-options='{"maxCount":300}'></oj-paging-control>

Get or set the loadMoreOptions property after initialization:

// Get one
var value = myPagingControl.loadMoreOptions.maxCount;

// Set one. Always use the setProperty API for 
// subproperties rather than setting a subproperty directly.
myPagingControl.setProperty('loadMoreOptions.maxCount', 300);

// Get all
var values = myPagingControl.loadMoreOptions;

// Set all.  Must list every loadMoreOptions key, as those not listed are lost.
myPagingControl.loadMoreOptions = {
    maxCount: 300
};

load-more-options.max-count :number

The maximum number items to display.

See the load-more-options attribute for usage examples.

Default Value:
  • 500
Names
Item Name
Property loadMoreOptions.maxCount

mode :string

Paging mode.
Supported Values:
Name Type Description
"loadMore" string Display paging control in high watermark mode.
"page" string Display paging control in pagination mode.
Default Value:
  • "page"
Names
Item Name
Property mode
Property change event modeChanged
Property change listener attribute (must be of type function) on-mode-changed
Examples

Initialize the PagingControl with the mode attribute specified:

<oj-paging-control mode='loadMore'></oj-paging-control>

Get or set the mode property after initialization:

// getter
var modeValue = myPagingControl.mode;

// setter
myPagingControl.mode = 'loadMore';

overflow :string

Options for when the PagingControl width is too narrow to accommodate the controls in the paging control
Supported Values:
Name Type Description
"fit" string Display as many controls as can fit in the PagingControl width.
"none" string Display all controls. Controls which cannot fit will be truncated.
Default Value:
  • "fit"
Names
Item Name
Property overflow
Property change event overflowChanged
Property change listener attribute (must be of type function) on-overflow-changed
Examples

Initialize the PagingControl with the overflow attribute specified:

<oj-paging-control overflow='none'></oj-paging-control>

Get or set the overflow property after initialization:

// getter
var overflowValue = myPagingControl.overflow;

// setter
myPagingControl.overflow = 'none';

page-options :Object.<string, Array|number>

Options for page mode.
Default Value:
  • {'layout': ['auto'], 'type': 'numbers', 'orientation': 'horizontal', 'maxPageLinks': 6}
Names
Item Name
Property pageOptions
Property change event pageOptionsChanged
Property change listener attribute (must be of type function) on-page-options-changed
Examples

Initialize the PagingControl, overriding some page-options values and leaving the others intact:

<!-- Using dot notation -->
<oj-paging-control page-options.some-key='some value' page-options.some-other-key='some other value'></oj-paging-control>

<!-- Using JSON notation -->
<oj-paging-control page-options='{"someKey":"some value", "someOtherKey":"some other value"}'></oj-paging-control>

Get or set the pageOptions property after initialization:

// Get one
var value = myPagingControl.pageOptions.someKey;

// Set one, leaving the others intact. Always use the setProperty API for 
// subproperties rather than setting a subproperty directly.
myPagingControl.setProperty('pageOptions.someKey', 'some value');

// Get all
var values = myPagingControl.pageOptions;

// Set all.  Must list every pageOptions key, as those not listed are lost.
myPagingControl.pageOptions = {
    someKey: 'some value',
    someOtherKey: 'some other value'
};

page-options.layout :Array

Array of paging navigation controls to be displayed (only applicable for numbers type).

This is an array of one or more supported values.

See the page-options attribute for usage examples.

Supported Values:
Name Type Description
'all' string Display all controls
'auto' string The PagingControl decides which controls to display
'input' string Display the page input control
'nav' string Display the navigation arrows
'pages' string Display the page links
'rangeText' string Display the page range text control
Default Value:
  • ['auto']
Names
Item Name
Property pageOptions.layout
The maximum number of page links to display (only applicable for numbers type). An ellipsis '...' will be displayed for pages which exceed the maximum. maxPageLinks must be greater than 4.

See the page-options attribute for usage examples.

Default Value:
  • 6
Names
Item Name
Property pageOptions.maxPageLinks

page-options.orientation :string

The orientation of the page links.

See the page-options attribute for usage examples.

Supported Values:
Name Type
'horizontal' string
'vertical' string
Default Value:
  • "horizontal"
Names
Item Name
Property pageOptions.orientation

page-options.type :string

The type of page links.

See the page-options attribute for usage examples.

Supported Values:
Name Type Description
'dots' string Render dots
'numbers' string Render numeric page links
Default Value:
  • "numbers"
Names
Item Name
Property pageOptions.type

page-size :number

Page size.

Default Value:
  • 25
Names
Item Name
Property pageSize
Property change event pageSizeChanged
Property change listener attribute (must be of type function) on-page-size-changed
Examples

Initialize the PagingControl with the page-size attribute specified:

<oj-paging-control page-size='50'></oj-paging-control>

Get or set the pageSize property after initialization:

// getter
var pageSizeValue = myPagingControl.pageSize;

// setter
myPagingControl.pageSize = 50;

translations :Object

A collection of translated resources from the translation bundle, or null if this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.

If this component has translations, their documentation immediately follows this doc entry.

Default Value:
  • an object containing all resources relevant to the component, or null if none
Names
Item Name
Property translations
Property change event translationsChanged
Property change listener attribute (must be of type function) on-translations-changed
Examples

Initialize the component, overriding some translated resources and leaving the others intact:

<!-- Using dot notation -->
<oj-some-element translations.some-key='some value' translations.some-other-key='some other value'></oj-some-element>

<!-- Using JSON notation -->
<oj-some-element translations='{"someKey":"some value", "someOtherKey":"some other value"}'></oj-some-element>

Get or set the translations property after initialization:

// Get one
var value = myComponent.translations.someKey;

// Set one, leaving the others intact. Always use the setProperty API for 
// subproperties rather than setting a subproperty directly.
myComponent.setProperty('translations.someKey', 'some value');

// Get all
var values = myComponent.translations;

// Set all.  Must list every resource key, as those not listed are lost.
myComponent.translations = {
    someKey: 'some value',
    someOtherKey: 'some other value'
};

translations.label-acc-nav-first-page :string

First page label for screen readers.

See the translations attribute for usage examples.

Default Value:
  • "First Page"
Names
Item Name
Property translations.labelAccNavFirstPage

translations.label-acc-nav-last-page :string

Last page label for screen readers.

See the translations attribute for usage examples.

Default Value:
  • "Last Page"
Names
Item Name
Property translations.labelAccNavLastPage

translations.label-acc-nav-next-page :string

Next page label for screen readers.

See the translations attribute for usage examples.

Default Value:
  • "Next Page"
Names
Item Name
Property translations.labelAccNavNextPage

translations.label-acc-nav-page :string

Current page label for screen readers.

See the translations attribute for usage examples.

Default Value:
  • "Page"
Names
Item Name
Property translations.labelAccNavPage

translations.label-acc-nav-previous-page :string

Previous page label for screen readers.

See the translations attribute for usage examples.

Default Value:
  • "Previous Page"
Names
Item Name
Property translations.labelAccNavPreviousPage

translations.label-acc-paging :string

Paging control label for screen readers.

See the translations attribute for usage examples.

Default Value:
  • "Pagination"
Names
Item Name
Property translations.labelAccPaging

translations.label-load-more :string

Load more link text.

See the translations attribute for usage examples.

Default Value:
  • "Show More..."
Names
Item Name
Property translations.labelLoadMore

translations.label-load-more-max-rows :string

Label for when load more has reached the maximum limit of rows to fetch.

See the translations attribute for usage examples.

Default Value:
  • "Reached Maximum Limit of {maxRows} rows"
Names
Item Name
Property translations.labelLoadMoreMaxRows

translations.label-nav-input-page :string

Current page label.

See the translations attribute for usage examples.

Default Value:
  • "Page"
Names
Item Name
Property translations.labelNavInputPage

translations.label-nav-input-page-max :string

Maximum page label.

See the translations attribute for usage examples.

Default Value:
  • "of {pageMax}"
Names
Item Name
Property translations.labelNavInputPageMax

translations.max-page-links-invalid :string

Invalid max page links value error.

See the translations attribute for usage examples.

Default Value:
  • "Value for maxPageLinks is invalid."
Names
Item Name
Property translations.maxPageLinksInvalid

translations.msg-item-range-current :string

Item range text for known row count.

See the translations attribute for usage examples.

Default Value:
  • "{pageFrom}-{pageTo}"
Names
Item Name
Property translations.msgItemRangeCurrent

translations.msg-item-range-current-single :string

Item range text for single page range.

See the translations attribute for usage examples.

Default Value:
  • "{pageFrom}"
Names
Item Name
Property translations.msgItemRangeCurrentSingle

translations.msg-item-range-items :string

Item range items text.

See the translations attribute for usage examples.

Default Value:
  • "items"
Names
Item Name
Property translations.msgItemRangeItems

translations.msg-item-range-of :string

Item range "of" text.

See the translations attribute for usage examples.

Default Value:
  • "of"
Names
Item Name
Property translations.msgItemRangeOf

translations.msg-item-range-of-approx :string

Item range "of approx" text.

See the translations attribute for usage examples.

Default Value:
  • "approx."
Names
Item Name
Property translations.msgItemRangeOfApprox

translations.msg-item-range-of-at-least :string

Item range "of at least" text.

See the translations attribute for usage examples.

Default Value:
  • "at least"
Names
Item Name
Property translations.msgItemRangeOfAtLeast

translations.page-invalid :string

Invalid page error.

See the translations attribute for usage examples.

Default Value:
  • "The page value entered is invalid."
Names
Item Name
Property translations.pageInvalid

translations.tip-nav-first-page :string

First page button tip.

See the translations attribute for usage examples.

Default Value:
  • "First"
Names
Item Name
Property translations.tipNavFirstPage

translations.tip-nav-input-page :string

Current page tip.

See the translations attribute for usage examples.

Default Value:
  • "Go To Page"
Names
Item Name
Property translations.tipNavInputPage

translations.tip-nav-last-page :string

Last page button tip.

See the translations attribute for usage examples.

Default Value:
  • "Last"
Names
Item Name
Property translations.tipNavLastPage

translations.tip-nav-next-page :string

Next page button tip.

See the translations attribute for usage examples.

Default Value:
  • "Next"
Names
Item Name
Property translations.tipNavNextPage

Current page link tip.

See the translations attribute for usage examples.

Default Value:
  • "Go To Page {pageNum}"
Names
Item Name
Property translations.tipNavPageLink

translations.tip-nav-previous-page :string

Previous page button tip.

See the translations attribute for usage examples.

Default Value:
  • "Previous"
Names
Item Name
Property translations.tipNavPreviousPage

Methods

firstPage() → {Promise}

Load the first page of data
Throws:
Type
Error
Returns:
promise object triggering done when complete.
Type
Promise
Example

Invoke the firstPage method:

myPagingControl.firstPage();

getProperty(property) → {*}

Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description
property string The property name to get. Supports dot notation for subproperty access.
Returns:
Type
*
Example

Get a single subproperty of a complex property:

var subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2');

lastPage() → {Promise}

Load the last page of data
Throws:
Type
Error
Returns:
promise object triggering done when complete.
Type
Promise
Example

Invoke the lastPage method:

myPagingControl.lastPage();

loadNext() → {Promise}

Load the next set of data
Throws:
Type
Error
Returns:
promise object triggering done when complete.
Type
Promise
Example

Invoke the loadNext method:

myPagingControl.loadNext();

nextPage() → {Promise}

Load the next page of data
Throws:
Type
Error
Returns:
promise object triggering done when complete.
Type
Promise
Example

Invoke the nextPage method:

myPagingControl.nextPage();

page(page) → {Promise}

Load the specified page of data
Parameters:
Name Type Description
page number Page number.
Throws:
Type
Error
Returns:
promise object triggering done when complete.
Type
Promise
Example

Invoke the page method:

myPagingControl.page(5);

previousPage() → {Promise}

Load the previous page of data
Throws:
Type
Error
Returns:
promise object triggering done when complete.
Type
Promise
Example

Invoke the previousPage method:

myPagingControl.previousPage();

refresh()

Refresh the paging control.
Example

Invoke the refresh method:

myPagingControl.refresh();

setProperties(properties)

Performs a batch set of properties.
Parameters:
Name Type Description
properties Object An object containing the property and value pairs to set.
Example

Set a batch of properties:

myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"});

setProperty(property, value)

Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description
property string The property name to set. Supports dot notation for subproperty access.
value * The new value to set the property to.
Example

Set a single subproperty of a complex property:

myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");