Element: <oj-film-strip>

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

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:
  • 5.0.0
Since:
  • 1.1.0
Module:
  • ojfilmstrip

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.


<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 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. This is documented under the "Default" heading below.

Default

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

Example

Initialize the film strip with child content specified:

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

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

arrow-placement :string

Specify the placement of the navigation arrows.
Supported Values:
Name Type Description
"adjacent" string Arrows are outside, adjacent to the filmStrip content. The arrows are still inside the bounds of the filmStrip element itself.
"overlay" string 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
Examples

Initialize the FilmStrip with the arrow-placement attribute specified:

<oj-film-strip arrow-placement='overlay'>
</oj-film-strip>

Get or set the arrowPlacement property after initialization:

// getter
var arrowPlacement = myFilmStrip.arrowPlacement;

// setter
myFilmStrip.arrowPlacement = 'overlay';

arrow-visibility :string

Specify the visibility of the navigation arrows.
Supported Values:
Name Type Description
"auto" string 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" string Arrows are hidden.
"hover" string Arrows are visible when the mouse is over the filmStrip, and hidden otherwise.
"visible" string 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
Examples

Initialize the FilmStrip with the arrow-visibility attribute specified:

<oj-film-strip arrow-visibility='visible'>
</oj-film-strip>

Get or set the arrowVisibility property after initialization:

// getter
var arrowVisibility = myFilmStrip.arrowVisibility;

// setter
myFilmStrip.arrowVisibility = 'visible';

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
Examples

Initialize the FilmStrip with the current-item attribute specified:

<!-- Using dot notation -->
<oj-film-strip current-item.index='3' current-item.id='thirdItemId'>
</oj-film-strip>

<!-- Using JSON notation -->
<oj-film-strip current-item='{"index" : 3, "id" : "thirdItemId"}'>
</oj-film-strip>

Get or set the currentItem property after initialization:

// Get one
var index = myFilmStrip.currentItem.index;

// Set one, leaving the others intact. Use the setProperty API for 
// subproperties so that a property change event is fired.
myFilmStrip.setProperty('currentItem.index', 1);

// Get all
var currentItem = myFilmStrip.currentItem;

// Set all
myFilmStrip.currentItem = {'index' : 3, 'id' : 'thirdItemId'};

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
Examples

Initialize the FilmStrip with the max-items-per-page attribute specified:

<oj-film-strip max-items-per-page='3'>
</oj-film-strip>

Get or set the maxItemsPerPage property after initialization:

// getter
var maxItemsPerPage = myFilmStrip.maxItemsPerPage;

// setter
myFilmStrip.maxItemsPerPage = 3;

orientation :string

Specify the orientation of the FilmStrip.
Supported Values:
Name Type Description
"horizontal" string Orient the FilmStrip horizontally.
"vertical" string 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
Examples

Initialize the FilmStrip with the orientation attribute specified:

<oj-film-strip orientation='vertical'>
</oj-film-strip>

Get or set the orientation property after initialization:

// getter
var orientation = myFilmStrip.orientation;

// setter
myFilmStrip.orientation = 'vertical';

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
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'
};

(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:
  • "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:
  • "Previous Page"
Since:
  • 1.1.0
Names
Item Name
Property translations.labelAccArrowPreviousPage

(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
Example

Invoke the getItemsPerPage method:

var itemsPerPage = myFilmStrip.getItemsPerPage();

getPagingModel() → {Object}

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
Object
Example

Invoke the getPagingModel method:

var pagingModel = myFilmStrip.getPagingModel();

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.
Since:
  • 4.0.0
Returns:
Type
*
Example

Get a single subproperty of a complex property:

var 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
Example

Invoke the refresh method:

myFilmStrip.refresh();

setProperties(properties) → {void}

Performs a batch set of properties.
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 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.
Since:
  • 4.0.0
Returns:
Type
void
Example

Set a single subproperty of a complex property:

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