Class sap.ui.ux3.NavigationItemModule: sap/ui/ux3/NavigationItem

extends Item
known direct subclasses: CountingNavigationItem

Is the item to be used within the NavigationBar

Deprecated API:Since version 1.38. Instead, use the sap.m.IconTabBar, sap.m.TabContainer or sap.uxap.ObjectPageLayout control.

Constructor Summary
new sap.ui.ux3.NavigationItem(sId?, mSettings?)Constructor for a new NavigationItem.
Method Summary
sap.ui.ux3.NavigationItem.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.ux3.NavigationItem with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.ux3.NavigationItem.getMetadata()Returns a metadata object for class sap.ui.ux3.NavigationItem.
addSubItem(oSubItem)Adds some subItem to the aggregation subItems.
destroySubItems()Destroys all the subItems in the aggregation subItems.
getHref()Gets current value of property href.
getSubItems()Gets content of aggregation subItems.
getVisible()Gets current value of property visible.
indexOfSubItem(oSubItem)Checks for the provided sap.ui.ux3.NavigationItem in the aggregation subItems.
insertSubItem(oSubItem, iIndex)Inserts a subItem into the aggregation subItems.
removeAllSubItems()Removes all the controls from the aggregation subItems.
removeSubItem(vSubItem)Removes a subItem from the aggregation subItems.
setHref(sHref)Sets a new value for property href.
setVisible(bVisible)Sets a new value for property visible.
Constructor Detail
new sap.ui.ux3.NavigationItem(sId?, mSettings?)
Constructor for a new NavigationItem.

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
    • visible : boolean (default: true)
    • href : sap.ui.core.URI
  • Aggregations
    • subItems : sap.ui.ux3.NavigationItem[] (default)

In addition, all settings applicable to the base type sap.ui.core.Item 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.IconTabBar, sap.m.TabContainer or sap.uxap.ObjectPageLayout control.
Method Detail
sap.ui.ux3.NavigationItem.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.ux3.NavigationItem 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.Item.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
sap.ui.ux3.NavigationItem.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.ux3.NavigationItem.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addSubItem(oSubItem): sap.ui.ux3.NavigationItem
Adds some subItem to the aggregation subItems.
Parameters:
{sap.ui.ux3.NavigationItem}oSubItem the subItem to add; if empty, nothing is inserted
Returns:
{sap.ui.ux3.NavigationItem} Reference to this in order to allow method chaining
destroySubItems(): sap.ui.ux3.NavigationItem
Destroys all the subItems in the aggregation subItems.
Returns:
{sap.ui.ux3.NavigationItem} Reference to this in order to allow method chaining
getHref(): sap.ui.core.URI
Gets current value of property href.

Defines the link target URL. This property is optional and should only be set when required! The use of the href property is to not only allow users to navigate in-place by left-clicking NavigationItems, but also to allow right-click and then "open in new tab" or "open in new window". As long as href is not set, an empty window will open and stay blank. But when href is set, the new window/tab will load this URL and it is the application's responsibility to display what the user expects (e.g. the Shell, with the respective NavigationItem being selected).

Returns:
{sap.ui.core.URI} Value of property href
getSubItems(): sap.ui.ux3.NavigationItem[]
Gets content of aggregation subItems.

Any NavigationItems on the next hierarchy level connected to this NavigationItem

Returns:
{sap.ui.ux3.NavigationItem[]}
getVisible(): boolean
Gets current value of property visible.

Whether the NavigationItem is currently visible. When making NavigationItems invisible at runtime it is the application's responsibility to make sure it is not the currently selected one - or to select another one in this case.

Default value is true.

Since:
1.9.0
Returns:
{boolean} Value of property visible
indexOfSubItem(oSubItem): int
Checks for the provided sap.ui.ux3.NavigationItem in the aggregation subItems. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.ux3.NavigationItem}oSubItem The subItem whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertSubItem(oSubItem, iIndex): sap.ui.ux3.NavigationItem
Inserts a subItem into the aggregation subItems.
Parameters:
{sap.ui.ux3.NavigationItem}oSubItem the subItem to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the subItem should be inserted at; for a negative value of iIndex, the subItem is inserted at position 0; for a value greater than the current size of the aggregation, the subItem is inserted at the last position
Returns:
{sap.ui.ux3.NavigationItem} Reference to this in order to allow method chaining
removeAllSubItems(): sap.ui.ux3.NavigationItem[]
Removes all the controls from the aggregation subItems.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.ux3.NavigationItem[]} An array of the removed elements (might be empty)
removeSubItem(vSubItem): sap.ui.ux3.NavigationItem
Removes a subItem from the aggregation subItems.
Parameters:
{int|string|sap.ui.ux3.NavigationItem}vSubItem The subItemto remove or its index or id
Returns:
{sap.ui.ux3.NavigationItem} The removed subItem or null
setHref(sHref): sap.ui.ux3.NavigationItem
Sets a new value for property href.

Defines the link target URL. This property is optional and should only be set when required! The use of the href property is to not only allow users to navigate in-place by left-clicking NavigationItems, but also to allow right-click and then "open in new tab" or "open in new window". As long as href is not set, an empty window will open and stay blank. But when href is set, the new window/tab will load this URL and it is the application's responsibility to display what the user expects (e.g. the Shell, with the respective NavigationItem being selected).

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{sap.ui.core.URI}sHref New value for property href
Returns:
{sap.ui.ux3.NavigationItem} Reference to this in order to allow method chaining
setVisible(bVisible): sap.ui.ux3.NavigationItem
Sets a new value for property visible.

Whether the NavigationItem is currently visible. When making NavigationItems invisible at runtime it is the application's responsibility to make sure it is not the currently selected one - or to select another one in this case.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bVisible New value for property visible
Since:
1.9.0
Returns:
{sap.ui.ux3.NavigationItem} Reference to this in order to allow method chaining