Usage
Signature:
interface TabBarElement<K, D>
Generic Parameters
Parameter Description K Type of key of the dataprovider D Type of data from the dataprovider
Typescript Import Format
//To typecheck the element APIs, import as below.
import { TabBarElement } from "ojs/ojnavigationlist";
//For the transpiled javascript to load the element's module, import as below
import "ojs/ojnavigationlist";
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.
Styling Classes
-
.oj-disabled
-
Any list item can be disabled by adding the oj-disabled class to that element
Deprecated:
Since Description 16.0.0
Disabled Tab Bar items are not recommended in the Redwood design system, tabs should be removed, not disabled. Example
<oj-tab-bar> <ul> <li id="foo" class="oj-disabled" > <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-focus-highlight
-
Under normal circumstances this class is applied automatically. It is documented here for the rare cases that an app developer needs per-instance control.
The oj-focus-highlight class applies focus styling that may not be desirable when the focus results from pointer interaction (touch or mouse), but which is needed for accessibility when the focus occurs by a non-pointer mechanism, for example keyboard or initial page load.
The application-level behavior for this component is controlled in the theme by the$focusHighlightPolicy
SASS variable; however, note that this same variable controls the focus highlight policy of many components and patterns. The values for the variable are:
nonPointer:
oj-focus-highlight is applied only when focus is not the result of pointer interaction. Most themes default to this value.
all:
oj-focus-highlight is applied regardless of the focus mechanism.
none:
oj-focus-highlight is never applied. This behavior is not accessible, and is intended for use when the application wishes to use its own event listener to precisely control when the class is applied (see below). The application must ensure the accessibility of the result.
To change the behavior on a per-instance basis, the application can set the SASS variable as desired and then use event listeners to toggle this class as needed.
Example
<oj-tab-bar class="oj-focus-highlight"> <!-- Content --> </oj-tab-bar>
-
.oj-removable
-
Use this class to make an item removable.
Example
<oj-tab-bar> <ul> <li id="foo" class="oj-removable" > <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-category-divider
-
Use this class to add a horizontal divider line between two categories of items.
Example
<oj-tab-bar> <ul> <li ...></li> <li class="oj-tabbar-category-divider"></li> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-hide-remove-icon
-
Use this class to hide the remove icon. In this case, Item can be removed using context menu.
Example
<oj-tab-bar class="oj-tabbar-hide-remove-icon" > <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-item-dividers
-
Note: This styleclass is not supported in the following themes:
Redwood
Use this class to render a divider between tab items. Note: On IE11, this is not supported when overflow attribute is set to 'popup'.Example
<oj-tab-bar class="oj-tabbar-item-dividers"> <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-item-end
-
Note: This styleclass is not supported in the following themes:
Alta
Use this class to add an badge/metadata/icon to a list item.Example
<oj-tab-bar class="oj-tabbar-item-end" > <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-end> <span class="oj-badge oj-badge-subtle">3 </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-item-icon
-
Use this class to add an icon to a list item.
Example
<oj-tab-bar class="oj-tabbar-stack-icon-label" > <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-item-label
-
Use this class to specify the element with the label. This will eliminate the need for Tabbar to automatically wrap any child element that is not an icon or a badge with this class. Note the content must have the correct order (icon element first, then the label element, then the badge element) as Tabbar in this case will not attempt to reorder the content.
Example
<oj-tab-bar class="oj-tabbar-stack-icon-label" > <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> <span class="oj-tabbar-item-label"> Foo </span> </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-item-text-wrap
-
Use this class to wrap item label text. Note: On IE11, this is not supported when overflow attribute is set to 'popup'. This style class is not supported when edge is 'top' or 'bottom'.
Deprecated:
Since Description 15.0.0
Since vertical layout of TabBar is deprecated, this should not be used anymore. Use NavigationList instead. Example
<oj-tab-bar class="oj-tabbar-item-text-wrap" > <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-item-title
-
When arbitrary content is placed inside an item's content area, its title text can be marked using this style class. This helps the component in identifying the Item's label.
Example
<li id="foo"> <div> <span class="oj-tabbar-item-title">Play</span> <button>Button</button> </div> </li>
-
.oj-tabbar-nofollow-link
-
Use this class to prevent automatic navigation to the url specified on an <a> tag's href attribute.
In this case, navigation can be handled programmatically by using selectionChanged event.
This is useful to execute some custom logic before browser triggers navigation.Example
<oj-tab-bar class="oj-tabbar-nofollow-link" > <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
.oj-tabbar-stack-icon-label
-
Use this class to display a horizontal Tab Bar with icons and labels stacked. Applicable only when edge is top.
Deprecated:
Since Description 9.0.0
Use display attribute instead. Example
<oj-tab-bar class="oj-tabbar-stack-icon-label" > <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
Category: Condense
-
Use this class to wrap item label text. Note: On IE11, this is not supported when overflow attribute is set to 'popup'.
Class template:
-
.oj-
[size]
-condenseNote: Square brackets signify required token substitutions whereas parentheses signify optional token substitutions.
-
Values for
[size]
Value (required) Name Description sm
Small Small screen size range md
Medium Medium screen size range lg
Large Large screen size range xl
X-Large Extra large screen size and up
Example
<oj-tab-bar class="oj-sm-condense" > <ul> <li id="foo"> <a href="#"> <span class="oj-tabbar-item-icon demo-icon-font-24 demo-palette-icon-24"> </span> Foo </a> </li> </ul> </oj-tab-bar>
-
-
CSS Variables
-
Default
-
Hovered
-
Active
-
Selected
Name | Type | Description |
---|---|---|
--oj-tab-bar-icon-to-text-padding |
<length> | Padding between icon and text |
--oj-tab-bar-icon-margin |
<length> | Tab bar icon margin |
--oj-tab-bar-icon-size |
<length> | Tab bar icon size |
--oj-tab-bar-item-margin |
<length> | Tab bar item margin |
--oj-tab-bar-item-padding |
<length> | Tab bar item padding |
--oj-tab-bar-item-min-height |
<length> | Tab bar item minimum height |
--oj-tab-bar-item-line-height |
<number> | Tab bar item line height |
--oj-tab-bar-item-font-size |
<length> | Tab bar item font size |
Name | Type | Description |
---|---|---|
--oj-tab-bar-item-font-weight |
<font_weight> | Default tab bar item font weight |
--oj-tab-bar-item-label-color |
<color> | Default tab bar item label color |
Name | Type | Description |
---|---|---|
--oj-tab-bar-item-label-color-hover |
<color> | Tab bar item label color when hovered |
--oj-tab-bar-item-bg-color-hover |
<color> | Tab bar item background color when hovered |
Name | Type | Description |
---|---|---|
--oj-tab-bar-item-bg-color-active |
<color> | Tab bar item background color when active |
--oj-tab-bar-item-border-color-active |
<color> | Tab bar item border color when active |
Name | Type | Description |
---|---|---|
--oj-tab-bar-item-font-weight-selected |
<font_weight> | Tab bar item font weight when selected |
--oj-tab-bar-item-label-color-selected |
<color> | Tab bar item label color when selected |
--oj-tab-bar-item-bg-color-selected |
<color> | Tab bar item background color when selected |
--oj-tab-bar-item-border-color-selected |
<color> | Tab bar item border color when selected |
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.
-
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 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.
-
itemTemplate
-
The
itemTemplate
slot is used to specify the template for rendering each item in the list. The slot content must be a <template> element. The content of the template could either include the <li> element, in which case that will be used as the root of the item. Or it can be just the content which excludes the <li> element.When the template is executed for each item, it will have access to the binding context containing the following properties:
- $current - an object that contains information for the current item. (See oj.ojTabBar.ItemTemplateContext or the table below for a list of properties available on $current)
- alias - if as attribute was specified, the value will be used to provide an application-named alias for $current.
Attributes
-
as :string
-
An alias for the current item when referenced inside the item template. This can be especially useful if oj-bind-for-each element is used inside the item template since it has its own scope of data access.
- Deprecated:
-
Since Description 6.2.0
Set the alias directly on the template element using the data-oj-as attribute instead.
- Default Value:
''
Names
Item Name Property as
Property change event asChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-as-changed
-
current-item :any
-
Key of the current item. Current item is the list item which is having active focus. Note that if currentItem is set to an item that is currently not available (not fetched or inside a collapsed parent node), then the value is ignored.
When the current item is changed, the
event.detail
of thecurrentItemChanged
event will contain the following additional properties:
Name Type Description item
Element Current Item element - Default Value:
null
- Supports writeback:
true
Names
Item Name Property currentItem
Property change event currentItemChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-current-item-changed
-
data :(TableDataSource|DataProvider|null) data :(DataProvider.<K, D>|null)
-
The data source for the Tab Bar accepts either a TableDataSource or DataProvider. See the data source section in the introduction for out of the box data source types. If the data attribute is not specified, the child elements are used as content. If there's no content specified, then an empty list is rendered.
- Default Value:
null
Names
Item Name Property data
Property change event dataChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-data-changed
-
display :"all"|"icons"|"stacked"
-
Whether to display both the label and icons (
"all"
) or just the icons ("icons"
). In the latter case, the label is displayed in a tooltip instead, unless a tooltip was already supplied at create time. Note: Ifdisplay="icons"
is used with oj-tabbar-item-end then it is supoorted only for badge and not for icon or metadata. Ifdisplay="stacked"
is used with oj-tabbar-item-end then it is supoorted only for badge and not for icon or metadata. It is also mandatory to provide icons for each item as stated in icons section.- Default Value:
all
Supported Values:
Value Description all
Display both the label and icons. icons
Display only the icons. stacked
Display icons with stacked label. Names
Item Name Property display
Property change event displayChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-display-changed
-
edge :"top"|"bottom"|"start"|"end" edge :"top"|"bottom"|"start"
-
The position of the Tab Bar. Valid Values: top and bottom.
- Deprecated:
-
Since Description 15.0.0
Use NavigationList instead. - Default Value:
start
Supported Values:
Value Description bottom
This renders list items horizontally. Generally used when tab bar placed on bottom of content section. end
This renders list items vertically. Generally used when tab bar placed on right/end of content section. start
This renders list items vertically. Generally used when tab bar placed on left/start of content section. top
This renders list items horizontally. Generally used when tab bar placed on top of content section. Names
Item Name Property edge
Property change event edgeChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-edge-changed
-
item :Object
-
The item property contains a subset of properties for items.
Names
Item Name Property item
Property change event itemChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-item-changed
-
(nullable) item.renderer :(((context: ojTabBar.ItemContext<K, D>) => void)|null)
-
The renderer function that renders the content of the item. See itemContext in the introduction to see the object passed into the renderer function. The function should return one of the following:
- An Object with the following property:
- insert: HTMLElement | string - A string or a DOM element of the content inside the item.
- undefined: If the developer chooses to manipulate the item element directly, the function should return undefined.
- Default Value:
null
Names
Item Name Property item.renderer
- An Object with the following property:
-
(nullable) item.selectable :(((context: ojTabBar.ItemContext<K, D>) => boolean)|boolean)
-
Whether the item is selectable. See itemContext in the introduction to see the object passed into the selectable function.
- Default Value:
true
Names
Item Name Property item.selectable
-
layout :"stretch"|"condense"
-
Whether to stretch the tab bar items to occupy available space or to condense items
- Default Value:
stretch
Supported Values:
Value Description condense
all items are condense stretch
all items are stretched Names
Item Name Property layout
Property change event layoutChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-layout-changed
-
overflow :"popup"|"hidden"
-
Specifies the overflow behaviour. NOTE: This is only applicable when
edge
attribute set totop
- Default Value:
hidden
Supported Values:
Value Description hidden
Overflow is clipped, and the rest of the content will be invisible. popup
Popup menu will be shown with overflowed items. Note that setting
overflow
topopup
can trigger browser reflow, so only set it when it is actually required.Names
Item Name Property overflow
Property change event overflowChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-overflow-changed
-
reorderable :"enabled"|"disabled"
-
Specifies if the tabs can be reordered within the tab bar by drag-and-drop.
- Default Value:
disabled
- Since:
- 4.1.0
Supported Values:
Value Description disabled
Disables reordering of items in tabbar. enabled
Enables reordering of items in tabbar. Names
Item Name Property reorderable
Property change event reorderableChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-reorderable-changed
-
selection :any
-
Item Key of currently selected list item. If the value is modified by an application, tab bar UI is modified to match the new value and the
event.detail
of theselectionChanged
event will contain the following additional properties:
Name Type Description item
Element Selected Item element - Default Value:
null
- Supports writeback:
true
Names
Item Name Property selection
Property change event selectionChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-changed
-
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, see Events and Listeners for additional information.) on-translations-changed
-
translations.accessible-reorder-after-item :string
-
Provides properties to customize the screen reader text when the tentative drop target is after a certain item.
- Default Value:
"After {item}"
- Since:
- 4.1.0
Names
Item Name Property translations.accessibleReorderAfterItem
-
translations.accessible-reorder-before-item :string
-
Provides properties to customize the screen reader text when the tentative drop target is before a certain item.
- Default Value:
"Before {item}"
- Since:
- 4.1.0
Names
Item Name Property translations.accessibleReorderBeforeItem
-
translations.accessible-reorder-touch-instruction-text :string
-
Provides properties to customize the screen reader touch instructional text for reordering items.
- Default Value:
"Double tap and hold. Wait for the sound then drag to rearrange."
- Since:
- 4.1.0
Names
Item Name Property translations.accessibleReorderTouchInstructionText
-
translations.label-cut :string
-
Provides properties to customize the context menu cut label.
See the translations attribute for usage examples.
- Default Value:
"Cut"
- Since:
- 4.1.0
Names
Item Name Property translations.labelCut
-
translations.label-paste-after :string
-
Provides properties to customize the context menu paste after label.
See the translations attribute for usage examples.
- Default Value:
"Paste After"
- Since:
- 4.1.0
Names
Item Name Property translations.labelPasteAfter
-
translations.label-paste-before :string
-
Provides properties to customize the context menu paste before label.
See the translations attribute for usage examples.
- Default Value:
"Paste Before"
- Since:
- 4.1.0
Names
Item Name Property translations.labelPasteBefore
-
translations.label-remove :string
-
Provides properties to customize the context menu remove label.
See the translations attribute for usage examples.
- Default Value:
"Remove"
- Since:
- 4.1.0
Names
Item Name Property translations.labelRemove
-
(nullable) translations.msg-fetching-data :string
-
Provides properties to customize the message text used by Tab Bar when waiting for data.
See the translations attribute for usage examples.
- Default Value:
"Fetching Data..."
- Since:
- 4.0.0
Names
Item Name Property translations.msgFetchingData
-
(nullable) translations.msg-no-data :string
-
Provides properties to customize the message text used by Tab Bar when there are no items.
See the translations attribute for usage examples.
- Deprecated:
-
Since Description 17.0.0
This option has been deprecate. We will no long have the message when no data.
- Default Value:
""
Names
Item Name Property translations.msgNoData
-
(nullable) translations.overflow-item-label :string
-
Label for overflow menu button.
See the translations attribute for usage examples.
- Default Value:
"More"
- Since:
- 4.0.0
Names
Item Name Property translations.overflowItemLabel
-
translations.remove-cue-text :string
-
Text cue for the removable tab, used as the aria-label for the close icon.
- Default Value:
"Removable"
- Since:
- 4.1.0
Names
Item Name Property translations.removeCueText
-
(nullable) translations.selected-label :string
-
Provides text to read to screen reader when an item is selected.
See the translations attribute for usage examples.
- Default Value:
"selected"
- Since:
- 4.0.0
Names
Item Name Property translations.selectedLabel
-
truncation :"none"|"progressive"
-
Truncation applies to the tab titles when there is not enough room to display all tabs.
- Default Value:
none
- Since:
- 4.1.0
Supported Values:
Value Description none
tabs always take up the space needed by the title texts. progressive
If not enough space is available to display all of the tabs, then the width of each tab title is restricted just enough to allow all tabs to fit. All tab titles that are truncated are displayed with ellipses. However the width of each tab title will not be truncated below a specific threshold defined by the theme. Names
Item Name Property truncation
Property change event truncationChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-truncation-changed
Context Objects
Each context object contains, at minimum, a subId
property,
whose value is a string that identifies a particular DOM node in this element. It can have additional properties to further specify the desired node. See getContextByNode for more details.
Properties:
Name | Type | Description |
---|---|---|
subId |
string | Sub-id string to identify a particular dom node. |
Following are the valid subIds:
-
oj-tabbar-item
-
Context for the oj-tab-bar component's items.
Properties:
Name Type Description index
number the zero based item index key
Object | string the Key of the item
Events
-
ojAnimateEnd
-
Triggered when the default animation of a particular action has ended. Note this event will not be triggered if application cancelled the default animation on animateStart.
- Deprecated:
-
Since Description 12.1.0
This web component no longer supports this event.
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information. -
ojAnimateStart
-
Triggered when the default animation of a particular action is about to start. The default animation can be cancelled by calling event.preventDefault.
- Deprecated:
-
Since Description 12.1.0
This web component no longer supports this event.
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information.Name Type Description action
string the action that triggers the animation.
See animation section for a list of actions.element
Element the target of animation. endCallback
function():void if the event listener calls event.preventDefault to cancel the default animation, it must call the endCallback function when it finishes its own animation handling and when any custom animation ends. -
ojBeforeCurrentItem
-
Triggered before the current item is changed via the
currentItem
property or via the UI. To prevent the item being focused, invokeevent.preventDefault()
.Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information. -
ojBeforeDeselect
-
Triggered immediately before a tab is deselected. To prevent the item being deselected, invoke
event.preventDefault()
.- Since:
- 4.1.0
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information.Name Type Description fromItem
Element the tab item being navigated from fromKey
any the Key of the tab item being navigated from toItem
Element the tab item being navigated to toKey
any the Key of the tab item being navigated to -
ojBeforeRemove
-
Triggered before the item is removed via the UI. To prevent the item being removed, invoke
event.preventDefault()
.- Since:
- 4.1.0
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information. -
ojBeforeSelect
-
Triggered before this list item is selected. To prevent the item selection, invoke
event.preventDefault()
.Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information. -
ojDeselect
-
Triggered after a tab has been deselected.
- Since:
- 4.1.0
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information.Name Type Description fromItem
Element the tab item being navigated from fromKey
any the Key of the tab item being navigated from toItem
Element the tab item being navigated to toKey
any the Key of the tab item being navigated to -
ojRemove
-
Triggered immediately after a tab is removed. This should be used to remove item from dom or from data source.
- Since:
- 4.1.0
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information. -
ojReorder
-
Triggered after reordering items within tabbar via drag and drop or cut and paste. This should be used to reorder item in dom or data source.
- Since:
- 4.1.0
Properties:
All of the event payloads listed below can be found under
event.detail
. See Events and Listeners for additional information.Name Type Description item
Element Item to be moved position
'before' | 'after' the drop position relative to the reference item. Possible values are "before" and "after". reference
Element the item where the moved items are drop on.
Methods
-
getContextByNode(node) : {(oj.ojTabBar.NodeContext.<K>|null)}
-
Returns an object with context for the given child DOM node. This will always contain the subid for the node, defined as the 'subId' property on the context object. Additional component specific information may also be included. For more details on returned objects, see context objects.
Parameters:
Name Type Argument Description node
Element <not nullable>
The child DOM node Returns:
The context for the DOM node, or
null
when none is found.- Type
- (oj.ojTabBar.NodeContext.<K>|null)
-
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 property
string The property name to get. Supports dot notation for subproperty access. - Since:
- 4.0.0
Returns:
- Type
- any
Example
let subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2');
-
refresh : {void}
-
Refreshes the visual state of the Tab Bar. JET components require a
refresh()
after the DOM is programmatically changed underneath the component.This method does not accept any arguments.
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 properties
Object An object containing the property and value pairs to set. - Since:
- 4.0.0
Returns:
- Type
- void
Example
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 property
string The property name to set. Supports dot notation for subproperty access. value
any The new value to set the property to. - Since:
- 4.0.0
Returns:
- Type
- void
Example
myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");
Type Definitions
-
ItemContext<K, D>
-
Properties:
Name Type Argument Description componentElement
Element oj-tab-bar element data
D The data object for the item. datasource
DataProvider.<K, D> <optional>
A reference to the data source object. (Not available for static content) index
number The index of the item, where 0 is the index of the first item. key
K The Key of the item. parentElement
Element The list item element. The renderer can use this to directly append content. -
ItemTemplateContext
-
NodeContext<K>
-
Properties:
Name Type Description index
number The index of the item, where 0 is the index of the first item. key
K The Key of the item. subId
string Sub-id string to identify a particular dom node.