Element: <oj-film-strip>

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

Signature:

class ojFilmStrip

QuickNav

Attributes

JET Custom Elements

JET components are implemented as custom HTML elements. In addition to the component attributes documented in this page, JET components also support standard HTML global attributes like id and aria-label.

The JET data binding syntax can be used to define both component and global attributes through the use of dynamically evaluated expressions. All attributes (component and global) support attribute-level binding by prefixing the attribute name with ":" (e.g. :id="[...]"). When using attribute-level binding, all expression values are treated as strings. Additionally, component attributes support property-level binding by using the attribute name directly with no ":" prefix. When using property-level binding, the expressions should evaluate to the types documented by the corresponding attributes. Property-level binding is strongly recommended over attribute-level binding for component attributes.

A detailed description of working with custom HTML elements can be found in: JET Custom Element Usage.



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

Version:
  • 7.1.0
Since:
  • 1.1.0
Module:
  • ojfilmstrip

Module usage

See JET Module Loading for an overview of module usage within JET.

Typescript Import Format
//To typecheck the element APIs, import as below.
import {ojFilmStrip} from "ojs/ojfilmstrip";

//For the transpiled javascript to load the element's module, import as below
import "ojs/ojfilmstrip";

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.


JET FilmStrip

Description: Container element that lays out its children in a single row or column across logical pages and allows navigating through them.

A JET FilmStrip can contain multiple direct child elements and all child elements are expected to be the same size.

FilmStrip will layout the child items across multiple logical pages and allow for changing between logical pages. When the element is resized, relayout will occur and the number of pages and number of items shown per page may change.

Note for performance reasons, if the FilmStrip content is expensive to render, you should wrap it in an oj-defer element (API doc oj.ojDefer) to defer the rendering of that content until it is shown by the filmstrip.
See the Film Strip - Deferred Rendering demo for an example.


<oj-film-strip>
  <div class='my-filmstrip-item'>Alpha</div>
  <div class='my-filmstrip-item'>Beta</div>
  <div class='my-filmstrip-item'>Gamma</div>
  <div class='my-filmstrip-item'>Delta</div>
  <div class='my-filmstrip-item'>Epsilon</div>
  <div class='my-filmstrip-item'>Zeta</div>
</oj-film-strip>

JET FilmStrip and ConveyorBelt look similar, but are intended to be used for different purposes.

Use FilmStrip when you want to:

  • layout a set of items across discrete logical pages
  • control which and how many items are shown
  • hide items outside the current viewport from tab order and screen reader

Use ConveyorBelt when you want to:

  • handle overflow without showing a scrollbar
  • keep all items accessible via tabbing and readable by a screen reader

Touch End User Information

Target Gesture Action
FilmStrip Swipe Transition to an adjacent logical page of child items.
Navigation Arrow Tap Transition to an adjacent logical page of child items.

Keyboard End User Information

FilmStrip itself is a tabstop and supports the following keyboard interactions:

Target Key Action
FilmStrip UpArrow or LeftArrow (RightArrow in RTL) Transition to the previous logical page of child items.
FilmStrip DownArrow or RightArrow (LeftArrow in RTL) Transition to the next logical page of child items.
FilmStrip Home Transition to the first logical page of child items.
FilmStrip End Transition to the last logical page of child items.
Navigation Arrow Enter or Space Transition to an adjacent logical page of child items.

Keyboard Application Developer Information

FilmStrip is for layout only. Providing keyboard support for the child items in the filmstrip is the responsibility of the application developer, if the items do not already support keyboard interaction. This could be done, for example, by specifying tabindex on each item to enable tab navigation among them.

Only the child items of the FilmStrip that are visible in the current logical page can be tabbed to. Items outside the current logical page are hidden from the tab order.

Accessibility

FilmStrip is for layout only. It is the responsibility of the application developer to make the items in the filmstrip accessible. Sighted keyboard-only users need to be able to access the items in the layout just by using the keyboard. It is up to the child items of the FilmStrip to support keyboard navigation.

Only the child items of the FilmStrip that are visible in the current logical page can be read by a screen reader. Items outside the current logical page are hidden from a screen reader.

FilmStrip assigns itself the WAI-ARIA role of "region". The application must specify a WAI-ARIA label for the FilmStrip element so that screen reader users will understand the purpose of the FilmStrip.

The application must provide accessible controls for navigating through the logical pages of the FilmStrip for use by screen reader users, because the arrow keys may be intercepted by the screen reader itself. The navigation arrows built into FilmStrip can be used, or if they are hidden, then alternative means, such as a paging control, must be provided.

Performance

Lazy Rendering

If there are many items in the FilmStrip or complex content in each item, it is recommended to implement lazy rendering of item content. The application should keep track of which items have rendered their content. Items that are initially visible in the FilmStrip should render their content from the start. The application should then listen to events from the FilmStrip's PagingModel in order to render content for items that are paged into view later.

Reading direction

As with any JET element, in the unusual case that the directionality (LTR or RTL) changes post-init, the FilmStrip must be refresh()ed.

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 components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.

Default

The <oj-film-strip> element lays out its children in a single row or column across logical pages and allows navigating through them.

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 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.

Attributes

arrow-placement :"adjacent"|"overlay"

Specify the placement of the navigation arrows.
Supported Values:
Value Description
"adjacent" Arrows are outside, adjacent to the filmStrip content. The arrows are still inside the bounds of the filmStrip element itself.
"overlay" Arrows are inside, overlaying the filmStrip content.
Default Value:
  • "adjacent"
Names
Item Name
Property arrowPlacement
Property change event arrowPlacementChanged
Property change listener attribute (must be of type function) on-arrow-placement-changed

arrow-visibility :"visible"|"hidden"|"hover"|"auto"

Specify the visibility of the navigation arrows.
Supported Values:
Value Description
"auto" Behaves as if the value were visible when the arrow-placement attribute is set to adjacent, and hover when the arrow-placement attribute is set to overlay.
"hidden" Arrows are hidden.
"hover" Arrows are visible when the mouse is over the filmStrip, and hidden otherwise.
"visible" Arrows are visible.
Default Value:
  • "auto"
Names
Item Name
Property arrowVisibility
Property change event arrowVisibilityChanged
Property change listener attribute (must be of type function) on-arrow-visibility-changed

current-item :{id?: string, index?: number}

Specify the child item whose logical page should be displayed. The position of the item on the logical page is not guaranteed.

This attribute can be set to an object containing either string id of the item or numeric 0-based index of the item or both. If the object contains both string id and numeric index, string id takes precedence.

FilmStrip will automatically update the value of this attribute when the logical page is changed to be the first item on the new logical page. When the value is updated automatically, it will be an object containing numeric index and string id, if available.

When the element is resized, FilmStrip will preserve the value of this attribute to show the new logical page on which the item is located.

Properties:
Name Type Argument Description
id string <optional>
string id of the item
index number <optional>
numeric 0-based index of the item
Default Value:
  • {"index" : 0}
Supports writeback:
  • true
Names
Item Name
Property currentItem
Property change event currentItemChanged
Property change listener attribute (must be of type function) on-current-item-changed

looping :"off"|"page"

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

Specify the navigation looping behavior.
Supported Values:
Value Description
"off" Navigation is bounded between first and last page and can't go any further in the direction of navigation.
"page" Navigation is not bounded between first and last page and can go further in the direction of navigation. This lets user to loop around from first page to last page or from last page to first page.
Default Value:
  • "off"
Names
Item Name
Property looping
Property change event loopingChanged
Property change listener attribute (must be of type function) on-looping-changed

max-items-per-page :number

Specify the maximum number of child items to show in a logical page. A value of 0 (the default) means that FilmStrip will show as many items per logical page as will fit based on the element and item sizes.

FilmStrip may show fewer than the specified number of items when max-items-per-page is set to a value other than 0 if the element size is smaller than what would be required to show that many items.

Default Value:
  • 0
See:
Names
Item Name
Property maxItemsPerPage
Property change event maxItemsPerPageChanged
Property change listener attribute (must be of type function) on-max-items-per-page-changed

orientation :"horizontal"|"vertical"

Specify the orientation of the FilmStrip.
Supported Values:
Value Description
"horizontal" Orient the FilmStrip horizontally.
"vertical" Orient the FilmStrip vertically.
Default Value:
  • "horizontal"
Names
Item Name
Property orientation
Property change event orientationChanged
Property change listener attribute (must be of type function) on-orientation-changed

translations :object|null

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 the component does not contain any translatable resource, the default value of this attribute will be null. If not, an object containing all resources relevant to the component.

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

Names
Item Name
Property translations
Property change event translationsChanged
Property change listener attribute (must be of type function) on-translations-changed

(nullable) translations.label-acc-arrow-next-page :string

Accessible label for the next page navigation arrow.

See the translations attribute for usage examples.

Default Value:
  • "Select Next to display next page"
Since:
  • 1.1.0
Names
Item Name
Property translations.labelAccArrowNextPage

(nullable) translations.label-acc-arrow-previous-page :string

Accessible label for the previous page navigation arrow.

See the translations attribute for usage examples.

Default Value:
  • "Select Previous to display previous page"
Since:
  • 1.1.0
Names
Item Name
Property translations.labelAccArrowPreviousPage

(nullable) translations.label-acc-film-strip :string

Accessible page information label for the filmstrip element.

See the translations attribute for usage examples.

Default Value:
  • "Displaying page {pageIndex} of {pageCount}"
Since:
  • 5.1.0
Names
Item Name
Property translations.labelAccFilmStrip

(nullable) translations.tip-arrow-next-page :string

Tooltip for the next page navigation arrow.

See the translations attribute for usage examples.

Default Value:
  • "Next"
Since:
  • 1.1.0
Names
Item Name
Property translations.tipArrowNextPage

(nullable) translations.tip-arrow-previous-page :string

Tooltip for the previous page navigation arrow.

See the translations attribute for usage examples.

Default Value:
  • "Previous"
Since:
  • 1.1.0
Names
Item Name
Property translations.tipArrowPreviousPage

Methods

getItemsPerPage() → {number}

Get the actual number of items shown per logical page.

The value returned by this method may be different from the value of the maxItemsPerPage property.

See:
Returns:
The actual number of items shown per logical page.
Type
number

getPagingModel() → {oj.PagingModel}

Get the PagingModel created and used by the FilmStrip. The PagingModel provides information about the FilmStrip's logical pages and a way to programmatically change pages.
Returns:
The instance of the PagingModel created and used by the FilmStrip.
Type
oj.PagingModel

getProperty(property) → {any}

Retrieves the value of a property or a subproperty. The return type will be the same as the type of the property as specified in this API document. If the method is invoked with an incorrect property/subproperty name, it returns undefined.
Parameters:
Name Type Description
property string The property name to get. Supports dot notation for subproperty access.
Since:
  • 4.0.0
Returns:
Type
any
Example

Get a single subproperty of a complex property:

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

refresh() → {void}

Refreshes the visual state of the FilmStrip. JET elements require a refresh() after the DOM is programmatically changed underneath the element.

This method does not accept any arguments.

Returns:
Type
void

setProperties(properties) → {void}

Performs a batch set of properties. The type of value for each property being set must match the type of the property as specified in this API document.
Parameters:
Name Type Description
properties Object An object containing the property and value pairs to set.
Since:
  • 4.0.0
Returns:
Type
void
Example

Set a batch of properties:

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

setProperty(property, value) → {void}

Sets a property or a subproperty (of a complex property) and notifies the component of the change, triggering a [property]Changed event. The value should be of the same type as the type of the attribute mentioned in this API document.
Parameters:
Name Type Description
property string The property name to set. Supports dot notation for subproperty access.
value any The new value to set the property to.
Since:
  • 4.0.0
Returns:
Type
void
Example

Set a single subproperty of a complex property:

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