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.
Event Summary
close(oControlEvent)Fires when the user closes a tab. select(oControlEvent)Fires when the user selects a tab. 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
. 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(mArguments?)Fires event close
to attached listeners. fireSelect(mArguments?)Fires event select
to attached listeners. getHeight()Gets current value of property height
. 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
. setHeight(sHeight)Sets a new value for property height
. setWidth(sWidth)Sets a new value for property width
. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty 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:
{string} | sId? | ID for the new control, generated automatically if no ID is given |
{object} | mSettings? | Initial settings for the new control |
- Deprecated:
- Since version 1.38. Instead, use the
sap.m.TabContainer
control.
Event Detail
close(oControlEvent)
Fires when the user closes a tab.
Parameters:
select(oControlEvent)
Fires when the user selects a tab.
Parameters:
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:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.commons.TabStrip.
Returns:
Adds some tab to the aggregation tabs
.
Parameters:
Returns:
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:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.commons.TabStrip itself |
Returns:
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:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.commons.TabStrip itself |
Returns:
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:
{int} | iIndex | The index of the tab that should be closed |
Creates a Tab and adds it to the TabStrip.
Parameters:
{string} | sText | Defines the title text of the newly created tab |
{sap.ui.core.Control} | oContent | Defines the root control of the content area |
Returns:
Destroys all the tabs in the aggregation tabs
.
Returns:
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:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
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:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
Fires event
close
to attached listeners.
Expects the following event parameters:
index
of type int
The index of the closed tab.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event
select
to attached listeners.
Expects the following event parameters:
index
of type int
The index of the selected tab.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
getEnableTabReordering(): boolean
Gets current value of property
enableTabReordering
.
Specifies whether tab reordering is enabled.
Default value is false
.
Returns:
{boolean} | Value of property enableTabReordering |
Gets current value of property
height
.
Specifies the height of the tab bar and content area.
Returns:
getSelectedIndex(): int
Gets current value of property
selectedIndex
.
Specifies the index of the currently selected tab.
Default value is 0
.
Returns:
{int} | Value of property selectedIndex |
Gets content of aggregation
tabs
.
The tabs contained in the TabStrip.
Returns:
Gets current value of property
width
.
Specifies the width of the bar and content area.
Returns:
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:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a tab into the aggregation tabs
.
Parameters:
{sap.ui.commons.Tab} | oTab | the tab to insert; if empty, nothing is inserted |
{int} | iIndex | the 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:
Removes all the controls from the aggregation
tabs
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes a tab from the aggregation tabs
.
Parameters:
Returns:
Sets whether tab reordering is enabled.
Parameters:
{boolean} | bValue | The value. |
Returns:
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:
Returns:
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:
{int} | iSelectedIndex | New value for property selectedIndex |
Returns:
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:
Returns: