Element: <oj-menu-select-many>

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

Signature:

class ojMenuSelectMany

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:
  • 6.0.0
Module:
  • ojmenuselectmany

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 {ojMenuSelectMany} from "ojs/ojmenuselectmany";

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

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 Menu Select Many

Description: JET Menu Select Many provides support for multiple selection of checkable menu items. The only supported component child element of oj-menu-select-many is oj-option. oj-menu-select-many cannot contain submenus but can be a child of a top-level oj-menu or submenu.

A JET Menu Select Many can be created with the following markup.


<!-- Including oj-option children -->
<oj-menu-select-many value="{{selectedColors}}">
  <oj-option value="blue">Blue</oj-option>
  <oj-option value="green">Green</oj-option>
  <oj-option value="red">Red</oj-option>
</oj-menu-select-many>

<!-- Collection bound simple syntax, no need to specify oj-option children -->
<oj-menu-select-many value="{{selectedColors}}" options="[[colorOptions]]">
</oj-menu-select-many>

Touch End User Information

Target Gesture Action
Menu Item Tap Invoke the menu item's action and toggle checked state.

Disabled items do not allow any touch interaction.

Keyboard End User Information

Target Key Action
Menu Item Enter or Space Invoke the focused menu item's action and toggles the checked state.
UpArrow Move focus to the previous menu item, wrapping around at the top.
DownArrow Move focus to the next menu item, wrapping around at the bottom.
Home Move focus to the first menu item.
End Move focus to the last menu item.
Menu Item in Top-level Menu Esc Close the menu and move focus to the launcher.

Disabled items can receive keyboard focus, but do not allow any other interaction.

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-menu-select-many> element accepts oj-option elements as children. See the oj-option documentation for details about accepted children and slots.

Attributes

disabled :boolean

Disables all the checkable menu items if set to true.
Default Value:
  • false
Since:
  • 6.0.0
Names
Item Name
Property disabled
Property change event disabledChanged
Property change listener attribute (must be of type function) on-disabled-changed

options :(Array.<oj.ojMenuSelectMany.Option>|oj.DataProvider.<any, any>|null)

Default Value:
  • null
Since:
  • 6.0.0
Names
Item Name
Property options
Property change event optionsChanged
Property change listener attribute (must be of type function) on-options-changed

value :Array.<any>

The value of the element. The value is an array with any type of items.
Default Value:
  • []
Supports writeback:
  • true
Since:
  • 6.0.0
Names
Item Name
Property value
Property change event valueChanged
Property change listener attribute (must be of type function) on-value-changed

Methods

getProperty(property) → {any}

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:
  • 6.0.0
Returns:
Type
any

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:
  • 6.0.0
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 [property]Changed event.
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:
  • 6.0.0
Returns:
Type
void

Type Definitions

Option

Properties:
Name Type Argument Description
id string <optional>
menu item id.
disabled boolean <optional>
menu item is disabled.
label string menu item label.
value any menu item value.