class sap.ui.ux3.NavigationItem

Control sample: sap.ui.ux3.NavigationItem
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/ux3/NavigationItem
Application Component: CA-UI5-CTR

Is the item to be used within the NavigationBar


Constructor

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

new sap.ui.ux3.NavigationItem(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


Properties

Name Type Default Value Description
href sap.ui.core.URI

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).

Visibility: public
visible boolean true

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.

Since: 1.9.0.

Visibility: public

Aggregations

Default Aggregation: subItems

Name Cardinality Type Description
subItems (default) 0..n sap.ui.ux3.NavigationItem

Any NavigationItems on the next hierarchy level connected to this NavigationItem


Methods Overview

Method Description
addSubItem

Adds some subItem to the aggregation subItems.

destroySubItems

Destroys all the subItems in the aggregation subItems.

sap.ui.ux3.NavigationItem.extend

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.

getHref

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).

sap.ui.ux3.NavigationItem.getMetadata

Returns a metadata object for class sap.ui.ux3.NavigationItem.

getSubItems

Gets content of aggregation subItems.

Any NavigationItems on the next hierarchy level connected to this NavigationItem

getVisible

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.

indexOfSubItem

Checks for the provided sap.ui.ux3.NavigationItem in the aggregation subItems. and returns its index if found or -1 otherwise.

insertSubItem

Inserts a subItem into the aggregation subItems.

removeAllSubItems

Removes all the controls from the aggregation subItems.

Additionally, it unregisters them from the hosting UIArea.

removeSubItem

Removes a subItem from the aggregation subItems.

setHref

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.

setVisible

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.

addSubItem

Adds some subItem to the aggregation subItems.

Param Type DefaultValue Description
oSubItem sap.ui.ux3.NavigationItem

The subItem to add; if empty, nothing is inserted

destroySubItems

Destroys all the subItems in the aggregation subItems.

sap.ui.ux3.NavigationItem.extend

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.

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

getHref

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).

sap.ui.ux3.NavigationItem.getMetadata

Returns a metadata object for class sap.ui.ux3.NavigationItem.

getSubItems

Gets content of aggregation subItems.

Any NavigationItems on the next hierarchy level connected to this NavigationItem

getVisible

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.

indexOfSubItem

Checks for the provided sap.ui.ux3.NavigationItem in the aggregation subItems. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oSubItem sap.ui.ux3.NavigationItem

The subItem whose index is looked for

insertSubItem

Inserts a subItem into the aggregation subItems.

Param Type DefaultValue Description
oSubItem sap.ui.ux3.NavigationItem

The subItem to insert; if empty, nothing is inserted

iIndex int

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

removeAllSubItems

Removes all the controls from the aggregation subItems.

Additionally, it unregisters them from the hosting UIArea.

removeSubItem

Removes a subItem from the aggregation subItems.

Param Type DefaultValue Description
vSubItem int string sap.ui.ux3.NavigationItem

The subItem to remove or its index or id

setHref

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.

Param Type DefaultValue Description
sHref sap.ui.core.URI

New value for property href

setVisible

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.

Param Type DefaultValue Description
bVisible boolean true

New value for property visible