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
slotattribute 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
slotattribute will be moved to the default slot, also known as a regular child. This is documented under the "Default" heading below.
-
Default
-
Child content for oj-option. This is normally the text node that displays for oj-option.
Example
Initialize the oj-option with child content specified:
<oj-option> Option label </oj-option> -
endIcon
-
Named slot for the oj-option's end icon.
Example
Initialize the oj-option with the
endIconslot specified:<oj-option> <span slot='endIcon'><img src='end.png' alt='End'></span> </oj-option> -
startIcon
-
Named slot for the oj-option's start icon.
Example
Initialize the oj-option with the
startIconslot specified:<oj-option> <span slot='startIcon'><img src='start.png' alt='Start'></span> </oj-option>
Attributes
-
disabled :boolean
-
Disables the oj-option if set to
true.- Default Value:
false
Names
Item Name Property disabledProperty change event disabledChangedProperty change listener attribute (must be of type function) on-disabled-changedExamples
Initialize the oj-option with the
disabledattribute specified:<oj-option disabled="[[isDisabled]]" value="option1">Option1</oj-option>Get or set the
disabledproperty after initialization:// getter var disabledValue = myOption.disabled; // setter myOption.disabled = true; -
value :any
-
Specifies the oj-option's value. The value is associated with the oj-option element whose display value may be different.
Names
Item Name Property valueProperty change event valueChangedProperty change listener attribute (must be of type function) on-value-changedExamples
Initialize the oj-option with the
valueattribute specified:<oj-option value="option1">Option1</oj-option>Get or set the
valueproperty after initialization:// getter var optionValue = myOption.value; // setter myOption.value = 'option1';
Methods
-
getProperty(property) → {any}
-
Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
Example
Get a single subproperty of a complex property:
var subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2'); -
refresh() → {void}
-
Refreshes the visual state of the component.
Returns:
- Type
- void
-
setProperties(properties) → {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. 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 propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. Returns:
- Type
- void
Example
Set a single subproperty of a complex property:
myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");