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-buttonset-one> element accepts
oj-optionelements as children. See the oj-option documentation for details about accepted children and slots. -
contextMenu
-
The contextMenu slot is set on the
oj-menuwithin 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
-
chroming :"solid"|"outlined"|"borderless"|"full"|"half"
-
Indicates in what states the buttonset's buttons have chrome (background and border).
A buttonset's chroming must be set by setting this buttonset attribute (or setting the chroming attribute of a containing toolbar).
The default chroming varies by theme and containership as follows:
- If the buttonset is in a toolbar, then the default chroming is the current value of the toolbar's chroming attribute.
- Else, if
$buttonsetChromingOptionDefaultis set in the current theme as seen in the example below, then that value is the chroming default. - Else, the default chroming is
"solid".
Once a value has been set on this buttonset attribute, that value applies regardless of theme and containership.
Supported Values:
Value Description "borderless"Borderless buttons are the least prominent variation. Borderless buttons are useful for supplemental actions that require minimal emphasis. "full"Deprecated: this value is deprecated and will be removed in the future. Please use solid instead. In typical themes, full-chrome buttons always have chrome. "half"Deprecated: this value is deprecated and will be removed in the future. Please use borderless instead. In typical themes, half-chrome buttons acquire chrome only in their hover, active, and selected states. A buttonset with half-chroming will be styled to have normal button spacing. "outlined"Outlined buttons are salient, but lighter weight than solid buttons. Outlined buttons are useful for secondary actions. "solid"Solid buttons stand out, and direct the user's attention to the most important actions in the UI. Names
Item Name Property chromingProperty change event chromingChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-chroming-changed -
(nullable) described-by :string
-
The oj-label sets the described-by attribute programmatically on the buttonset component. This attribute is not meant to be set by an application developer directly. The described-by is copied to the aria-describedby attribute on the component's inner dom element, and it is needed for accessibility.
Names
Item Name Property describedByProperty change event describedByChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-described-by-changed -
disabled :boolean
-
Setting the Buttonset's
disabledattribute effectively disables all its Buttons, without affecting theirdisabledattributes. Thus, a Button is effectively disabled if either its owndisabledattribute is set, or the Buttonset'sdisabledattribute is set.- Default Value:
false
Names
Item Name Property disabledProperty change event disabledChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-disabled-changed -
display :"all"|"icons"
-
Whether to display both the label and icons (
"all") or just the icons ("icons") of the buttons. In the latter case, the label is displayed in a tooltip instead.The
displayattribute will be ignored if no icons exist in the button.- Default Value:
"all"
Supported Values:
Value Description "all"Display both the label and icons. "icons"Display only the icons. Names
Item Name Property displayProperty change event displayChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-display-changed -
focus-management :"oneTabstop"|"none"
-
The
focusManagementattribute should be set to"none"when the Buttonset is placed in a JET Toolbar. This allows the Toolbar to manage the focus with no interference from the Buttonset, so that arrow keys move within the entire Toolbar, not just within the Buttonset.- Default Value:
"oneTabstop"
Supported Values:
Value Description "none"Focus management is disabled, to avoid interfering with the focus management of a containing component. "oneTabstop"Focus management is enabled. The Buttonset is a single tabstop with arrow-key navigation. Names
Item Name Property focusManagementProperty change event focusManagementChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-focus-management-changed -
labelled-by :string|null
-
It is used to establish a relationship between this component and another element. A common use is to tie the oj-label and the oj-buttonset together for accessibility. The oj-label custom element has an id, and you use the labelled-by attribute to tie the two components together to facilitate correct screen reader behavior.
Names
Item Name Property labelledByProperty change event labelledByChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-labelled-by-changed -
translations :object|null
-
A collection of translated resources from the translation bundle, or
nullif 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 translationsProperty change event translationsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-translations-changed -
value :any
-
The
valueattribute indicates whichoj-optionin the Buttonset is selected. It corresponds to thevalueattribute of theoj-option, which should always be set.valueis any type equal to thevalueattribute of the selectedoj-option. The attribute isnullif and only if nooj-optionis selected. Thus, an n-oj-optiongroup has n+1 validvaluevalues: the noj-optionvalues, andnull.In all other cases,
valueisnull.It's still possible for the
valueattribute and DOM to get out of sync by other means. In this case, the app is responsible for updating thevalueattribute. A typical case is when the set of Buttons contained in the Buttonset changes, possibly due to a Knockout binding, in which case the app must first callrefresh(as in all cases when the DOM changes underneath a component), and then update thevalueattribute to the desired value.Often there is no need to listen for this event, since the
valuebinding, discussed above, will update the bound observable whenever thevaluestate changes. The declarative binding is often preferable to an explicit listener.A click listener should not be used to detect changes to the
valuestate. The attributevaluebinding and/or thevalueChangeevent should be used instead.- Default Value:
null
- Supports writeback:
true
Names
Item Name Property valueProperty change event valueChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-value-changed
Methods
-
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 propertystring 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 component.
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 propertiesObject 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 propertystring The property name to set. Supports dot notation for subproperty access. valueany 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");