TabStrip represents a container for tab controls, which contain the content and generally other controls. The user switches between the tabs to display the content.
Constructor for a new TabStrip.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.ui.commons.TabStrip(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new control, generated automatically if no ID is given |
|
mSettings? | object | Initial settings for the new control |
Name | Type | Default Value | Description |
---|---|---|---|
enableTabReordering | boolean | false | Specifies whether tab reordering is enabled. Visibility: public |
height | sap.ui.core.CSSSize | Specifies the height of the tab bar and content area. Visibility: public |
|
selectedIndex | int | 0 | Specifies the index of the currently selected tab. Visibility: public |
width | sap.ui.core.CSSSize | Specifies the width of the bar and content area. Visibility: public |
Default Aggregation: tabs
Name | Cardinality | Type | Description |
---|---|---|---|
_leftArrowControl | 0..1 | sap.ui.core.Icon |
The left arrow, used for tab scrolling. |
_rightArrowControl | 0..1 | sap.ui.core.Icon |
The right arrow, used for tab scrolling. |
tabs (default) | 0..n | sap.ui.commons.Tab |
The tabs contained in the TabStrip. |
Method | Description |
---|---|
addTab |
Adds some tab to the aggregation tabs. |
attachClose |
Attaches event handler When called, the context of the event handler (its Fires when the user closes a tab. |
attachSelect |
Attaches event handler When called, the context of the event handler (its Fires when the user selects a tab. |
closeTab |
Closes a tab (if the tab is selected, the next one will be selected; if it's the last tab, the previous one will be selected). This method should be called if the close event is fired. It can not be called automatically because the consumer might need to run some logic before the tab is closed. |
createTab |
Creates a Tab and adds it to the TabStrip. |
destroyTabs |
Destroys all the tabs in the aggregation tabs. |
detachClose |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSelect |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.commons.TabStrip.extend |
Creates a new subclass of class sap.ui.commons.TabStrip with name
|
fireClose |
Fires event close to attached listeners. |
fireSelect |
Fires event select to attached listeners. |
getEnableTabReordering |
Gets current value of property enableTabReordering. Specifies whether tab reordering is enabled. Default value is |
getHeight |
Gets current value of property height. Specifies the height of the tab bar and content area. |
sap.ui.commons.TabStrip.getMetadata |
Returns a metadata object for class sap.ui.commons.TabStrip. |
getSelectedIndex |
Gets current value of property selectedIndex. Specifies the index of the currently selected tab. Default value is |
getTabs |
Gets content of aggregation tabs. The tabs contained in the TabStrip. |
getWidth |
Gets current value of property width. Specifies the width of the bar and content area. |
indexOfTab |
Checks for the provided |
insertTab |
Inserts a tab into the aggregation tabs. |
onBeforeRendering |
Called before the rendering of the control is started. |
removeAllTabs |
Removes all the controls from the aggregation tabs. Additionally, it unregisters them from the hosting UIArea. |
removeTab |
Removes a tab from the aggregation tabs. |
setEnableTabReordering |
Sets whether tab reordering is enabled. |
setHeight |
Sets a new value for property height. Specifies the height of the tab bar and content area. When called with a value of |
setSelectedIndex |
Sets a new value for property selectedIndex. Specifies the index of the currently selected tab. When called with a value of Default value is |
setWidth |
Sets a new value for property width. Specifies the width of the bar and content area. When called with a value of |
Adds some tab to the aggregation tabs.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTab | sap.ui.commons.Tab |
The tab to add; if empty, nothing is inserted |
Attaches event handler fnFunction
to the close event of this sap.ui.commons.TabStrip
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.commons.TabStrip
itself.
Fires when the user closes a tab.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the select event of this sap.ui.commons.TabStrip
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.commons.TabStrip
itself.
Fires when the user selects a tab.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Closes a tab (if the tab is selected, the next one will be selected; if it's the last tab, the previous one will be selected).
This method should be called if the close event is fired. It can not be called automatically because the consumer might need to run some logic before the tab is closed.
Param | Type | DefaultValue | Description |
---|---|---|---|
iIndex | int |
The index of the tab that should be closed |
Creates a Tab and adds it to the TabStrip.
Param | Type | DefaultValue | Description |
---|---|---|---|
sText | string |
Defines the title text of the newly created tab |
|
oContent | sap.ui.core.Control |
Defines the root control of the content area |
Detaches event handler fnFunction
from the close event of this sap.ui.commons.TabStrip
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the select event of this sap.ui.commons.TabStrip
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Creates a new subclass of class sap.ui.commons.TabStrip with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.Control.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event close to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
index | int |
The index of the closed tab. |
Fires event select to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
index | int |
The index of the selected tab. |
Gets current value of property enableTabReordering.
Specifies whether tab reordering is enabled.
Default value is false
.
Gets current value of property height.
Specifies the height of the tab bar and content area.
Gets current value of property selectedIndex.
Specifies the index of the currently selected tab.
Default value is 0
.
Checks for the provided sap.ui.commons.Tab
in the aggregation tabs. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTab | sap.ui.commons.Tab |
The tab whose index is looked for |
Inserts a tab into the aggregation tabs.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTab | sap.ui.commons.Tab |
The tab to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation tabs.
Additionally, it unregisters them from the hosting UIArea.
Removes a tab from the aggregation tabs.
Param | Type | DefaultValue | Description |
---|---|---|---|
vTab | int string sap.ui.commons.Tab |
The tab to remove or its index or id |
Sets whether tab reordering is enabled.
Param | Type | DefaultValue | Description |
---|---|---|---|
bValue | boolean |
The value. |
Sets a new value for property height.
Specifies the height of the tab bar and content area.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHeight | sap.ui.core.CSSSize |
New value for property |
Sets a new value for property selectedIndex.
Specifies the index of the currently selected tab.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iSelectedIndex | int | 0 |
New value for property |
Sets a new value for property width.
Specifies the width of the bar and content area.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize |
New value for property |