Element: <oj-c-selector>

CORE PACK

Oracle® JavaScript Extension Toolkit (JET)
15.1.0

F83698-01

Since:
  • 15.0.0
Module:
  • selector

QuickNav

Attributes

Other Topics


JET Selector

Description: A checkbox to support selection in Collection Components

The oj-c-selector is a component that may be placed within a template for Table, ListView. It presents as a checkbox when the Collection Component is configured for multi-selection.


<oj-c-list-view
   id="listview"
   data="[[dataProvider]]"
   selected="{{selectedItems}}"
   selection-mode="[[selectedSelectionMode]]">
 <template slot="itemTemplate" data-oj-as="item">
   <oj-c-list-item-layout>
     <oj-c-selector
       selected-keys="{{selectedItems}}"
       selection-mode="[[selectedSelectionMode]]"
       row-key='[[item.key]]'
       slot="selector">
     </oj-c-selector>
     <span>
       <oj-bind-text value="[[item.data.name]]"></oj-bind-text>
     </span>
   </oj-c-list-item-layout>
 </template>
</oj-c-list-view>

Accessibility

Application must specify a value for the aria-label attribute with a meaningful description of the purpose of this selector in order for this to be accessible.


Usage

Signature:

interface CSelectorElement<K extends string | number>

Generic Parameters
ParameterDescription
{object}K Type of key
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CSelectorElement } from "oj-c/selector";

//For the transpiled javascript to load the element's module, import as below
import "oj-c/selector";

For additional information visit:

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.


Attributes

indeterminate :boolean

Specifies if the selector should show the visual partial state. The original checked state of the selector will still be maintained. User selection of checkboxes will remove the indeterminate state and reveal the checkbox state. Otherwise, programmatically changing the checkbox state will not change the indeterminate state.
Default Value:
  • false
Names
Item Name
Property indeterminate
Property change event indeterminateChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-indeterminate-changed

row-key :K

Specifies the row key of each selector.
Names
Item Name
Property rowKey
Property change event rowKeyChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-row-key-changed

selected-keys :ImmutableKeySet.<K>

Specifies the selectedKeys, should be hooked into the collection component.
Supports writeback:
  • true
Names
Item Name
Property selectedKeys
Property change event selectedKeysChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selected-keys-changed

selection-mode :"multiple"|"single"

Specifies the selection mode ('single', 'multiple'). For selection mode 'all', please refer to oj-c-selector-all component.
Supported Values:
Value Description
multiple Multiple items can be selected at the same time.
single Only a single item can be selected at a time.
Default Value:
  • "multiple"
Names
Item Name
Property selectionMode
Property change event selectionModeChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-mode-changed

Methods

getProperty(property) : {any}

Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description
property The property name to get. Supports dot notation for subproperty access.
Returns:
Type
any

setProperties(properties) : {void}

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

setProperty(property, value) : {void}

Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description
property The property name to set. Supports dot notation for subproperty access.
value The new value to set the property to.
Returns:
Type
void