Class sap.ui.commons.TabStripModule: sap/ui/commons/TabStrip

extends Control

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.
Deprecated API:
Since version 1.38. Instead, use the sap.m.TabContainer control.
Constructor Summary
new sap.ui.commons.TabStrip(sId?, mSettings?)Constructor for a new TabStrip.
Event Summary
close(oControlEvent)Fires when the user closes a tab.
select(oControlEvent)Fires when the user selects a tab.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.TabStrip.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.TabStrip with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.TabStrip.getMetadata()Returns a metadata object for class sap.ui.commons.TabStrip.
addTab(oTab)Adds some tab to the aggregation tabs.
attachClose(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the close event of this sap.ui.commons.TabStrip.
attachSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the select event of this sap.ui.commons.TabStrip.
closeTab(iIndex)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).
createTab(sText, oContent)Creates a Tab and adds it to the TabStrip.
destroyTabs()Destroys all the tabs in the aggregation tabs.
detachClose(fnFunction, oListener)Detaches event handler fnFunction from the close event of this sap.ui.commons.TabStrip.
detachSelect(fnFunction, oListener)Detaches event handler fnFunction from the select event of this sap.ui.commons.TabStrip.
fireClose(mParameters?)Fires event close to attached listeners.
fireSelect(mParameters?)Fires event select to attached listeners.
getEnableTabReordering()Gets current value of property enableTabReordering.
getHeight()Gets current value of property height.
getSelectedIndex()Gets current value of property selectedIndex.
getTabs()Gets content of aggregation tabs.
getWidth()Gets current value of property width.
indexOfTab(oTab)Checks for the provided sap.ui.commons.Tab in the aggregation tabs.
insertTab(oTab, iIndex)Inserts a tab into the aggregation tabs.
removeAllTabs()Removes all the controls from the aggregation tabs.
removeTab(vTab)Removes a tab from the aggregation tabs.
setEnableTabReordering(bValue)Sets whether tab reordering is enabled.
setHeight(sHeight)Sets a new value for property height.
setSelectedIndex(iSelectedIndex)Sets a new value for property selectedIndex.
setWidth(sWidth)Sets a new value for property width.
Constructor Detail
new sap.ui.commons.TabStrip(sId?, mSettings?)

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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties

  • Aggregations

    • tabs : sap.ui.commons.Tab[] (default)

  • Events

    • select : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • close : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
stringsId?ID for the new control, generated automatically if no ID is given
objectmSettings?Initial settings for the new control
Event Detail
close(oControlEvent)
Fires when the user closes a tab.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
intoControlEvent.getParameters.indexThe index of the closed tab.
select(oControlEvent)
Fires when the user selects a tab.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
intoControlEvent.getParameters.indexThe index of the selected tab.
Method Detail
sap.ui.commons.TabStrip.extend(sClassName, oClassInfo?, FNMetaImpl?): function

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.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.commons.TabStrip.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.TabStrip.
Returns:
sap.ui.base.MetadataMetadata object describing this class
Adds some tab to the aggregation tabs.
Parameters:
sap.ui.commons.TaboTabthe tab to add; if empty, nothing is inserted
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
attachClose(oData?, fnFunction, oListener?): sap.ui.commons.TabStrip

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.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.commons.TabStrip itself
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
attachSelect(oData?, fnFunction, oListener?): sap.ui.commons.TabStrip

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.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.commons.TabStrip itself
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
closeTab(iIndex): void

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.

Parameters:
intiIndexThe index of the tab that should be closed
createTab(sText, oContent): sap.ui.commons.Tab
Creates a Tab and adds it to the TabStrip.
Parameters:
stringsTextDefines the title text of the newly created tab
sap.ui.core.ControloContentDefines the root control of the content area
Returns:
sap.ui.commons.TaboTab The created tab control
destroyTabs(): sap.ui.commons.TabStrip
Destroys all the tabs in the aggregation tabs.
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
detachClose(fnFunction, oListener): sap.ui.commons.TabStrip

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.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
detachSelect(fnFunction, oListener): sap.ui.commons.TabStrip

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.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
fireClose(mParameters?): sap.ui.commons.TabStrip
Fires event close to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
intmParameters.index?The index of the closed tab.
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
fireSelect(mParameters?): sap.ui.commons.TabStrip
Fires event select to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
intmParameters.index?The index of the selected tab.
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
getEnableTabReordering(): boolean

Gets current value of property enableTabReordering.

Specifies whether tab reordering is enabled.

Default value is false.

Returns:
booleanValue of property enableTabReordering
getHeight(): sap.ui.core.CSSSize

Gets current value of property height.

Specifies the height of the tab bar and content area.

Returns:
sap.ui.core.CSSSizeValue of property height
getSelectedIndex(): int

Gets current value of property selectedIndex.

Specifies the index of the currently selected tab.

Default value is 0.

Returns:
intValue of property selectedIndex
getTabs(): sap.ui.commons.Tab[]

Gets content of aggregation tabs.

The tabs contained in the TabStrip.

Returns:
sap.ui.commons.Tab[]
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

Specifies the width of the bar and content area.

Returns:
sap.ui.core.CSSSizeValue of property width
indexOfTab(oTab): int
Checks for the provided sap.ui.commons.Tab in the aggregation tabs. and returns its index if found or -1 otherwise.
Parameters:
sap.ui.commons.TaboTabThe tab whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
insertTab(oTab, iIndex): sap.ui.commons.TabStrip
Inserts a tab into the aggregation tabs.
Parameters:
sap.ui.commons.TaboTabthe tab to insert; if empty, nothing is inserted
intiIndexthe 0-based index the tab should be inserted at; for a negative value of iIndex, the tab is inserted at position 0; for a value greater than the current size of the aggregation, the tab is inserted at the last position
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
removeAllTabs(): sap.ui.commons.Tab[]

Removes all the controls from the aggregation tabs.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.ui.commons.Tab[]An array of the removed elements (might be empty)
removeTab(vTab): sap.ui.commons.Tab
Removes a tab from the aggregation tabs.
Parameters:
int|string|sap.ui.commons.TabvTabThe tab to remove or its index or id
Returns:
sap.ui.commons.TabThe removed tab or null
setEnableTabReordering(bValue): sap.ui.commons.TabStrip
Sets whether tab reordering is enabled.
Parameters:
booleanbValueThe value.
Returns:
sap.ui.commons.TabStripPointer to the control instance for chaining.
setHeight(sHeight): sap.ui.commons.TabStrip

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.

Parameters:
sap.ui.core.CSSSizesHeightNew value for property height
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
setSelectedIndex(iSelectedIndex): sap.ui.commons.TabStrip

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.

Parameters:
intiSelectedIndexNew value for property selectedIndex
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining
setWidth(sWidth): sap.ui.commons.TabStrip

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.

Parameters:
sap.ui.core.CSSSizesWidthNew value for property width
Returns:
sap.ui.commons.TabStripReference to this in order to allow method chaining