Class sap.ui.ux3.NavigationBarModule: sap/ui/ux3/NavigationBar

extends Control

Provides enhanced navigation capabilities and is the parent control of NavigationItem. It is displayed in the form of a horizontal line with switching markers depending on the currently selected item. The size of an item which is currently chosen by the user is enlarged. In the case that a large number of items are defined for the bar, this is made transparent to the user by showing symbols for scrolling options (forwards and backwards) to see the next or previous items.
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.NavigationBar(sId?, mSettings?)Constructor for a new NavigationBar.
Event Summary
select(oControlEvent)Event is fired when an item is selected by the user
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.ux3.NavigationBar.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.ux3.NavigationBar with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.ux3.NavigationBar.getMetadata()Returns a metadata object for class sap.ui.ux3.NavigationBar.
addAssociatedItem(vAssociatedItem)Adds some associatedItem into the association associatedItems.
addItem(oItem)Adds some item to the aggregation items.
attachSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the select event of this sap.ui.ux3.NavigationBar.
destroyItems()Destroys all the items in the aggregation items.
detachSelect(fnFunction, oListener)Detaches event handler fnFunction from the select event of this sap.ui.ux3.NavigationBar.
fireSelect(mParameters?)Fires event select to attached listeners.
getAssociatedItems()Returns array of IDs of the elements which are the current targets of the association associatedItems.
getItems()Gets content of aggregation items.
getOverflowItemsToUpperCase()Gets current value of property overflowItemsToUpperCase.
getSelectedItem()ID of the element which is the current target of the association selectedItem, or null.
getToplevelVariant()Gets current value of property toplevelVariant.
indexOfItem(oItem)Checks for the provided sap.ui.ux3.NavigationItem in the aggregation items.
insertItem(oItem, iIndex)Inserts a item into the aggregation items.
isSelectedItemValid()Returns whether there is a selectedItem set which is actually present in the items aggregation; or, if the aggregation is empty, in the associatedItems association.
removeAllAssociatedItems()Removes all the controls in the association named associatedItems.
removeAllItems()Removes all the controls from the aggregation items.
removeAssociatedItem(vAssociatedItem)Removes an associatedItem from the association named associatedItems.
removeItem(vItem)Removes a item from the aggregation items.
setAssociatedItems(aItems)Replaces the currently associated items with the ones in the given array
setOverflowItemsToUpperCase(bOverflowItemsToUpperCase)Sets a new value for property overflowItemsToUpperCase.
setSelectedItem(oSelectedItem)Sets the associated selectedItem.
setToplevelVariant(bToplevelVariant)Sets a new value for property toplevelVariant.
Constructor Detail
new sap.ui.ux3.NavigationBar(sId?, mSettings?)

Constructor for a new NavigationBar.

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

    • items : sap.ui.ux3.NavigationItem[] (default)

  • Associations

  • Events

    • select : 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
select(oControlEvent)
Event is fired when an item is selected by the user
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
stringoControlEvent.getParameters.itemIdThe ID of the newly selected NavigationItem.
sap.ui.ux3.NavigationItemoControlEvent.getParameters.itemThe newly selected NavigationItem.
Method Detail
sap.ui.ux3.NavigationBar.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.ui.ux3.NavigationBar 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.ux3.NavigationBar.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.ux3.NavigationBar.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addAssociatedItem(vAssociatedItem): sap.ui.ux3.NavigationBar
Adds some associatedItem into the association associatedItems.
Parameters:
sap.ui.core.ID|sap.ui.ux3.NavigationItemvAssociatedItemthe associatedItems to add; if empty, nothing is inserted
Returns:
sap.ui.ux3.NavigationBarReference to this in order to allow method chaining
addItem(oItem): sap.ui.ux3.NavigationBar
Adds some item to the aggregation items.
Parameters:
sap.ui.ux3.NavigationItemoItemthe item to add; if empty, nothing is inserted
Returns:
sap.ui.ux3.NavigationBarReference to this in order to allow method chaining
attachSelect(oData?, fnFunction, oListener?): sap.ui.ux3.NavigationBar

Attaches event handler fnFunction to the select event of this sap.ui.ux3.NavigationBar.

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.ux3.NavigationBar itself.

Event is fired when an item is selected by the user

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.ux3.NavigationBar itself
Returns:
sap.ui.ux3.NavigationBarReference to this in order to allow method chaining
destroyItems(): sap.ui.ux3.NavigationBar
Destroys all the items in the aggregation items.
Returns:
sap.ui.ux3.NavigationBarReference to this in order to allow method chaining
detachSelect(fnFunction, oListener): sap.ui.ux3.NavigationBar

Detaches event handler fnFunction from the select event of this sap.ui.ux3.NavigationBar.

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.ux3.NavigationBarReference to this in order to allow method chaining
fireSelect(mParameters?): boolean

Fires event select to attached listeners.

Listeners may prevent the default action of this event by using the preventDefault-method on the event object.

Parameters:
objectmParameters?Parameters to pass along with the event
stringmParameters.itemId?The ID of the newly selected NavigationItem.
sap.ui.ux3.NavigationItemmParameters.item?The newly selected NavigationItem.
Returns:
booleanWhether or not to prevent the default action
getAssociatedItems(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association associatedItems.
Returns:
sap.ui.core.ID[]

Gets content of aggregation items.

If the navigation items need to have a different parent than the NavigationBar, alternatively the associatedItems association can be used. The NavigationBar follows the approach to use the items aggregation. If this aggregation is empty, associatedItems is used.

Returns:
sap.ui.ux3.NavigationItem[]
getOverflowItemsToUpperCase(): boolean

Gets current value of property overflowItemsToUpperCase.

Sets the appearance of the menu items in the overflow menu to uppercase

Default value is false.

Returns:
booleanValue of property overflowItemsToUpperCase
Since:
1.36
getSelectedItem(): sap.ui.core.ID
ID of the element which is the current target of the association selectedItem, or null.
Returns:
sap.ui.core.ID
getToplevelVariant(): boolean

Gets current value of property toplevelVariant.

Defines whether the navigation bar shall have top-level appearance

Default value is false.

Returns:
booleanValue of property toplevelVariant
indexOfItem(oItem): int
Checks for the provided sap.ui.ux3.NavigationItem in the aggregation items. and returns its index if found or -1 otherwise.
Parameters:
sap.ui.ux3.NavigationItemoItemThe item whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
insertItem(oItem, iIndex): sap.ui.ux3.NavigationBar
Inserts a item into the aggregation items.
Parameters:
sap.ui.ux3.NavigationItemoItemthe item to insert; if empty, nothing is inserted
intiIndexthe 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position
Returns:
sap.ui.ux3.NavigationBarReference to this in order to allow method chaining
isSelectedItemValid(): boolean
Returns whether there is a selectedItem set which is actually present in the items aggregation; or, if the aggregation is empty, in the associatedItems association.
Returns:
boolean
removeAllAssociatedItems(): sap.ui.core.ID[]
Removes all the controls in the association named associatedItems.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAllItems(): sap.ui.ux3.NavigationItem[]

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.ui.ux3.NavigationItem[]An array of the removed elements (might be empty)
removeAssociatedItem(vAssociatedItem): sap.ui.core.ID
Removes an associatedItem from the association named associatedItems.
Parameters:
int|sap.ui.core.ID|sap.ui.ux3.NavigationItemvAssociatedItemThe associatedItem to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed associatedItem or null
removeItem(vItem): sap.ui.ux3.NavigationItem
Removes a item from the aggregation items.
Parameters:
int|string|sap.ui.ux3.NavigationItemvItemThe item to remove or its index or id
Returns:
sap.ui.ux3.NavigationItemThe removed item or null
setAssociatedItems(aItems): sap.ui.ux3.NavigationBar
Replaces the currently associated items with the ones in the given array
Parameters:
sap.ui.ux3.NavigationItem[]aItemsThe items to associate
Returns:
sap.ui.ux3.NavigationBar
setOverflowItemsToUpperCase(bOverflowItemsToUpperCase): sap.ui.ux3.NavigationBar

Sets a new value for property overflowItemsToUpperCase.

Sets the appearance of the menu items in the overflow menu to uppercase

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

Default value is false.

Parameters:
booleanbOverflowItemsToUpperCaseNew value for property overflowItemsToUpperCase
Returns:
sap.ui.ux3.NavigationBarReference to this in order to allow method chaining
Since:
1.36
setSelectedItem(oSelectedItem): sap.ui.ux3.NavigationBar
Sets the associated selectedItem.
Parameters:
sap.ui.core.ID|sap.ui.ux3.NavigationItemoSelectedItemID of an element which becomes the new target of this selectedItem association; alternatively, an element instance may be given
Returns:
sap.ui.ux3.NavigationBarReference to this in order to allow method chaining
setToplevelVariant(bToplevelVariant): sap.ui.ux3.NavigationBar

Sets a new value for property toplevelVariant.

Defines whether the navigation bar shall have top-level appearance

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

Default value is false.

Parameters:
booleanbToplevelVariantNew value for property toplevelVariant
Returns:
sap.ui.ux3.NavigationBarReference to this in order to allow method chaining