Class sap.m.NavContainerModule: sap/m/NavContainer

extends Control
known direct subclasses: App

The NavContainer control handles hierarchic navigation between Pages or other fullscreen controls.

All children of this control will receive navigation events like beforeShow, they are documented in the pseudo interface sap.m.NavContainerChild

Constructor Summary
new sap.m.NavContainer(sId?, mSettings?)Constructor for a new NavContainer.
Event Summary
afterNavigate(oControlEvent)The event is fired when navigation between two pages has completed.
navigate(oControlEvent)The event is fired when navigation between two pages has been triggered.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.NavContainer.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.NavContainer with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.NavContainer.getMetadata()Returns a metadata object for class sap.m.NavContainer.
addCustomTransition(sName, oTo, oBack)Adds a custom transition to the NavContainer type (not to a particular instance!).
addPage(oPage)Adds some page to the aggregation pages.
attachAfterNavigate(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the afterNavigate event of this sap.m.NavContainer.
attachNavigate(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the navigate event of this sap.m.NavContainer.
back(oBackData?, oTransitionParameters?)Navigates back one level.
backToPage(sPageId, oBackData?, oTransitionParameters?)Navigates back to the nearest previous page in the NavContainer history with the given ID.
backToTop(oBackData?, oTransitionParameters?)Navigates back to the initial/top level (this is the element aggregated as "initialPage", or the first added element).
currentPageIsTopPage()Returns whether the current page is the top/initial page.
destroyPages()Destroys all the pages in the aggregation pages.
detachAfterNavigate(fnFunction, oListener)Detaches event handler fnFunction from the afterNavigate event of this sap.m.NavContainer.
detachNavigate(fnFunction, oListener)Detaches event handler fnFunction from the navigate event of this sap.m.NavContainer.
fireAfterNavigate(mParameters?)Fires event afterNavigate to attached listeners.
fireNavigate(mParameters?)Fires event navigate to attached listeners.
getAutoFocus()Gets current value of property autoFocus.
getCurrentPage()Returns the currently displayed page-level control.
getDefaultTransitionName()Gets current value of property defaultTransitionName.
getHeight()Gets current value of property height.
getInitialPage()ID of the element which is the current target of the association initialPage, or null.
getPage(sId)Returns the control with the given ID from the "pages" aggregation (if available).
getPages()Gets content of aggregation pages.
getPreviousPage()Returns the previous page (the page from which the user drilled down to the current page with "to()").
getVisible()Gets current value of property visible.
getWidth()Gets current value of property width.
indexOfPage(oPage)Checks for the provided sap.ui.core.Control in the aggregation pages.
insertPage(oPage, iIndex)Inserts a page into the aggregation pages.
insertPreviousPage(sPageId, sTransitionName?, oData?)Inserts the page/control with the specified ID into the navigation history stack of the NavContainer.
removeAllPages()Removes all the controls from the aggregation pages.
removePage(vPage)Removes a page from the aggregation pages.
setAutoFocus(bAutoFocus)Sets a new value for property autoFocus.
setDefaultTransitionName(sDefaultTransitionName)Sets a new value for property defaultTransitionName.
setHeight(sHeight)Sets a new value for property height.
setInitialPage(oInitialPage)Sets the associated initialPage.
setVisible(bVisible)Sets a new value for property visible.
setWidth(sWidth)Sets a new value for property width.
to(sPageId, sTransitionName?, oData?, oTransitionParameters?)Navigates to the next page (with drill-down semantic) with the given (or default) animation.
Constructor Detail
new sap.m.NavContainer(sId?, mSettings?)

Constructor for a new NavContainer.

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

    • pages : sap.ui.core.Control[] (default)

  • Associations

  • Events

    • navigate : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • afterNavigate : 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
afterNavigate(oControlEvent)
The event is fired when navigation between two pages has completed. In case of animated transitions this event is fired with some delay after the "navigate" event.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.ui.core.ControloControlEvent.getParameters.fromThe page which had been shown before navigation.
stringoControlEvent.getParameters.fromIdThe ID of the page which had been shown before navigation.
sap.ui.core.ControloControlEvent.getParameters.toThe page which is now shown after navigation.
stringoControlEvent.getParameters.toIdThe ID of the page which is now shown after navigation.
booleanoControlEvent.getParameters.firstTimeWhether the "to" page (more precisely: a control with the ID of the page which has been navigated to) had not been shown/navigated to before.
booleanoControlEvent.getParameters.isToWhether was a forward navigation, triggered by "to()".
booleanoControlEvent.getParameters.isBackWhether this was a back navigation, triggered by "back()".
booleanoControlEvent.getParameters.isBackToTopWhether this was a navigation to the root page, triggered by "backToTop()".
booleanoControlEvent.getParameters.isBackToPageWhether this was a navigation to a specific page, triggered by "backToPage()".
stringoControlEvent.getParameters.directionHow the navigation was triggered, possible values are "to", "back", "backToPage", and "backToTop".
Since:
1.7.1
navigate(oControlEvent)
The event is fired when navigation between two pages has been triggered. The transition (if any) to the new page has not started yet. This event can be aborted by the application with preventDefault(), which means that there will be no navigation.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.ui.core.ControloControlEvent.getParameters.fromThe page which was shown before the current navigation.
stringoControlEvent.getParameters.fromIdThe ID of the page which was shown before the current navigation.
sap.ui.core.ControloControlEvent.getParameters.toThe page which will be shown after the current navigation.
stringoControlEvent.getParameters.toIdThe ID of the page which will be shown after the current navigation.
booleanoControlEvent.getParameters.firstTimeWhether the "to" page (more precisely: a control with the ID of the page which is currently navigated to) has not been shown/navigated to before.
booleanoControlEvent.getParameters.isToWhether this is a forward navigation, triggered by "to()".
booleanoControlEvent.getParameters.isBackWhether this is a back navigation, triggered by "back()".
booleanoControlEvent.getParameters.isBackToTopWhether this is a navigation to the root page, triggered by "backToTop()".
booleanoControlEvent.getParameters.isBackToPageWhether this was a navigation to a specific page, triggered by "backToPage()".
stringoControlEvent.getParameters.directionHow the navigation was triggered, possible values are "to", "back", "backToPage", and "backToTop".
Since:
1.7.1
Method Detail
sap.m.NavContainer.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.m.NavContainer 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.m.NavContainer.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.NavContainer.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addCustomTransition(sName, oTo, oBack): sap.m.NavContainer

Adds a custom transition to the NavContainer type (not to a particular instance!). The transition is identified by a "name". Make sure to only use names that will not collide with transitions which may be added to the NavContainer later. A suggestion is to use the prefix "c_" or "_" for your custom transitions to ensure this.

"to" and "back" are the transition functions for the forward and backward navigation. Both will be called with the following parameters: - oFromPage: the Control which is currently being displayed by the NavContainer - oToPage: the Control which should be displayed by the NavContainer after the transition - fCallback: a function which MUST be called when the transition has completed - oTransitionParameters: a data object that can be given by application code when triggering the transition by calling to() or back(); this object could give additional information to the transition function, like the DOM element which triggered the transition or the desired transition duration

The contract for "to" and "back" is that they may do an animation of their choice, but it should not take "too long". At the beginning of the transition the target page "oToPage" does have the CSS class "sapMNavItemHidden" which initially hides the target page (visibility:hidden). The transition can do any preparation (e.g. move that page out of the screen or make it transparent) and then should remove this CSS class. After the animation the target page "oToPage" should cover the entire screen and the source page "oFromPage" should not be visible anymore. This page should then have the CSS class "sapMNavItemHidden". For adding/removing this or other CSS classes, the transition can use the addStyleClass/removeStyleClass method: oFromPage.addStyleClass("sapMNavItemHidden"); When the transition is complete, it MUST call the given fCallback method to inform the NavContainer that navigation has finished!

Hint: if the target page of your transition stays black on iPhone, try wrapping the animation start into a setTimeout(..., 0) block (delayed, but without waiting).

This method can be called on any NavContainer instance or statically on the sap.m.NavContainer type. However, the transition will always be registered for the type (and ALL instances), not for the single instance on which this method was invoked.

Returns the sap.m.NavContainer type if called statically, or "this" (to allow method chaining) if called on a particular NavContainer instance.

Parameters:
stringsName

The name of the transition. This name can be used by the application to choose this transition when navigating "to()" or "back()": the "transitionName" parameter of "NavContainer.to()" corresponds to this name, the back() navigation will automatically use the same transition.

Make sure to only use names that will not collide with transitions which may be added to the NavContainer later. A suggestion is to use the prefix "c_" or "_" for your custom transitions to ensure this.

objectoTo

The function which will be called by the NavContainer when the application navigates "to()", using this animation's name. The NavContainer instance is the "this" context within the animation function.

See the documentation of NavContainer.addCustomTransitions for more details about this function.

objectoBack

The function which will be called by the NavContainer when the application navigates "back()" from a page where it had navigated to using this animation's name. The NavContainer instance is the "this" context within the animation function.

See the documentation of NavContainer.addCustomTransitions for more details about this function.

Returns:
sap.m.NavContainer
addPage(oPage): sap.m.NavContainer
Adds some page to the aggregation pages.
Parameters:
sap.ui.core.ControloPagethe page to add; if empty, nothing is inserted
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
attachAfterNavigate(oData?, fnFunction, oListener?): sap.m.NavContainer

Attaches event handler fnFunction to the afterNavigate event of this sap.m.NavContainer.

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.m.NavContainer itself.

The event is fired when navigation between two pages has completed. In case of animated transitions this event is fired with some delay after the "navigate" event.

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.m.NavContainer itself
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
Since:
1.7.1
attachNavigate(oData?, fnFunction, oListener?): sap.m.NavContainer

Attaches event handler fnFunction to the navigate event of this sap.m.NavContainer.

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.m.NavContainer itself.

The event is fired when navigation between two pages has been triggered. The transition (if any) to the new page has not started yet. This event can be aborted by the application with preventDefault(), which means that there will be no navigation.

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.m.NavContainer itself
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
Since:
1.7.1
back(oBackData?, oTransitionParameters?): sap.m.NavContainer

Navigates back one level. If already on the initial page and there is no place to go back, nothing happens.

Calling this navigation method triggers first the (cancelable) "navigate" event on the NavContainer, then the "beforeHide" pseudo event on the source page and "beforeFirstShow" (if applicable) and"beforeShow" on the target page. Later - after the transition has completed - the "afterShow" pseudo event is triggered on the target page and "afterHide" on the page which has been left. The given backData object is available in the "beforeFirstShow", "beforeShow" and "afterShow" event object as "data" property. The original "data" object from the "to" navigation is also available in these event objects.

Parameters:
objectoBackData?

Since version 1.7.1. This optional object can carry any payload data which should be made available to the target page of the back navigation. The event on the target page will contain this data object as "backData" property. (The original data from the "to()" navigation will still be available as "data" property.)

In scenarios where the entity triggering the navigation can or should not directly initialize the target page, it can fill this object and the target page itself (or a listener on it) can take over the initialization, using the given data. For back navigation this can be used e.g. when returning from a detail page to transfer any settings done there.

When the "transitionParameters" object is used, this "data" object must also be given (either as object or as null) in order to have a proper parameter order.

objectoTransitionParameters?

Since version 1.7.1. This optional object can give additional information to the transition function, like the DOM element which triggered the transition or the desired transition duration. The animation type can NOT be selected here - it is always the inverse of the "to" navigation.

In order to use the "transitionParameters" property, the "data" property must be used (at least "null" must be given) for a proper parameter order.

NOTE: it depends on the transition function how the object should be structured and which parameters are actually used to influence the transition.

Returns:
sap.m.NavContainer
backToPage(sPageId, oBackData?, oTransitionParameters?): sap.m.NavContainer

Navigates back to the nearest previous page in the NavContainer history with the given ID. If there is no such page among the previous pages, nothing happens. The transition effect which had been used to get to the current page is inverted and used for this navigation.

Calling this navigation method triggers first the (cancelable) "navigate" event on the NavContainer, then the "beforeHide" pseudo event on the source page and "beforeFirstShow" (if applicable) and"beforeShow" on the target page. Later - after the transition has completed - the "afterShow" pseudo event is triggered on the target page and "afterHide" on the page which has been left. The given backData object is available in the "beforeFirstShow", "beforeShow" and "afterShow" event object as "data" property. The original "data" object from the "to" navigation is also available in these event objects.

Parameters:
stringsPageIdThe ID of the screen to which back navigation should happen. The ID or the control itself can be given. The nearest such page among the previous pages in the history stack will be used.
objectoBackData?

This optional object can carry any payload data which should be made available to the target page of the "backToPage" navigation. The event on the target page will contain this data object as "backData" property.

When the "transitionParameters" object is used, this "data" object must also be given (either as object or as null) in order to have a proper parameter order.

objectoTransitionParameters?

This optional object can give additional information to the transition function, like the DOM element which triggered the transition or the desired transition duration. The animation type can NOT be selected here - it is always the inverse of the "to" navigation.

In order to use the "transitionParameters" property, the "data" property must be used (at least "null" must be given) for a proper parameter order.

NOTE: it depends on the transition function how the object should be structured and which parameters are actually used to influence the transition.

Returns:
sap.m.NavContainer
Since:
1.7.2
backToTop(oBackData?, oTransitionParameters?): sap.m.NavContainer

Navigates back to the initial/top level (this is the element aggregated as "initialPage", or the first added element). If already on the initial page, nothing happens. The transition effect which had been used to get to the current page is inverted and used for this navigation.

Calling this navigation method triggers first the (cancelable) "navigate" event on the NavContainer, then the "beforeHide" pseudo event on the source page and "beforeFirstShow" (if applicable) and"beforeShow" on the target page. Later - after the transition has completed - the "afterShow" pseudo event is triggered on the target page and "afterHide" on the page which has been left. The given backData object is available in the "beforeFirstShow", "beforeShow" and "afterShow" event object as "data" property.

Parameters:
objectoBackData?

This optional object can carry any payload data which should be made available to the target page of the "backToTop" navigation. The event on the target page will contain this data object as "backData" property.

When the "transitionParameters" object is used, this "data" object must also be given (either as object or as null) in order to have a proper parameter order.

objectoTransitionParameters?

This optional object can give additional information to the transition function, like the DOM element which triggered the transition or the desired transition duration. The animation type can NOT be selected here - it is always the inverse of the "to" navigation.

In order to use the "transitionParameters" property, the "data" property must be used (at least "null" must be given) for a proper parameter order.

NOTE: it depends on the transition function how the object should be structured and which parameters are actually used to influence the transition.

Returns:
sap.m.NavContainer
Since:
1.7.1
currentPageIsTopPage(): boolean

Returns whether the current page is the top/initial page.

Note: going to the initial page again with a row of "to" navigations causes the initial page to be displayed again, but logically one is not at the top level, so this method returns "false" in this case.

Returns:
boolean
destroyPages(): sap.m.NavContainer
Destroys all the pages in the aggregation pages.
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
detachAfterNavigate(fnFunction, oListener): sap.m.NavContainer

Detaches event handler fnFunction from the afterNavigate event of this sap.m.NavContainer.

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.m.NavContainerReference to this in order to allow method chaining
Since:
1.7.1
detachNavigate(fnFunction, oListener): sap.m.NavContainer

Detaches event handler fnFunction from the navigate event of this sap.m.NavContainer.

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.m.NavContainerReference to this in order to allow method chaining
Since:
1.7.1
fireAfterNavigate(mParameters?): sap.m.NavContainer
Fires event afterNavigate to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
sap.ui.core.ControlmParameters.from?The page which had been shown before navigation.
stringmParameters.fromId?The ID of the page which had been shown before navigation.
sap.ui.core.ControlmParameters.to?The page which is now shown after navigation.
stringmParameters.toId?The ID of the page which is now shown after navigation.
booleanmParameters.firstTime?Whether the "to" page (more precisely: a control with the ID of the page which has been navigated to) had not been shown/navigated to before.
booleanmParameters.isTo?Whether was a forward navigation, triggered by "to()".
booleanmParameters.isBack?Whether this was a back navigation, triggered by "back()".
booleanmParameters.isBackToTop?Whether this was a navigation to the root page, triggered by "backToTop()".
booleanmParameters.isBackToPage?Whether this was a navigation to a specific page, triggered by "backToPage()".
stringmParameters.direction?How the navigation was triggered, possible values are "to", "back", "backToPage", and "backToTop".
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
Since:
1.7.1
fireNavigate(mParameters?): boolean

Fires event navigate 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
sap.ui.core.ControlmParameters.from?The page which was shown before the current navigation.
stringmParameters.fromId?The ID of the page which was shown before the current navigation.
sap.ui.core.ControlmParameters.to?The page which will be shown after the current navigation.
stringmParameters.toId?The ID of the page which will be shown after the current navigation.
booleanmParameters.firstTime?Whether the "to" page (more precisely: a control with the ID of the page which is currently navigated to) has not been shown/navigated to before.
booleanmParameters.isTo?Whether this is a forward navigation, triggered by "to()".
booleanmParameters.isBack?Whether this is a back navigation, triggered by "back()".
booleanmParameters.isBackToTop?Whether this is a navigation to the root page, triggered by "backToTop()".
booleanmParameters.isBackToPage?Whether this was a navigation to a specific page, triggered by "backToPage()".
stringmParameters.direction?How the navigation was triggered, possible values are "to", "back", "backToPage", and "backToTop".
Returns:
booleanWhether or not to prevent the default action
Since:
1.7.1
getAutoFocus(): boolean

Gets current value of property autoFocus.

Determines whether the initial focus is set automatically on first rendering and after navigating to a new page. This is useful when on touch devices the keyboard pops out due to the focus being automatically set on an input field. If necessary the "afterShow" event can be used to focus another element.

Note: The following scenarios are possible, depending on where the focus was before navigation to a new page:

  • If autoFocus is set to true and the focus was inside the current page, the focus will be moved automatically on the new page.
  • If autoFocus is set to false and the focus was inside the current page, the focus will disappear.
  • If the focus was outside the current page, after the navigation it will remain unchanged regardless of what is set to the autoFocus property.

Default value is true.

Returns:
booleanValue of property autoFocus
Since:
1.30
getCurrentPage(): sap.ui.core.Control

Returns the currently displayed page-level control. Note: it is not necessarily an instance of sap.m.Page, but it could also be an sap.ui.core.View, sap.m.Carousel, or whatever is aggregated.

Returns undefined if no page has been added yet.

Returns:
sap.ui.core.Control
getDefaultTransitionName(): string

Gets current value of property defaultTransitionName.

The type of the transition/animation to apply when "to()" is called without defining a transition type to use. The default is "slide". Other options are: "fade", "flip" and "show" - and the names of any registered custom transitions.

Default value is slide.

Returns:
stringValue of property defaultTransitionName
Since:
1.7.1
getHeight(): sap.ui.core.CSSSize

Gets current value of property height.

The height of the NavContainer. Can be changed when the NavContainer should not cover the whole available area.

Default value is 100%.

Returns:
sap.ui.core.CSSSizeValue of property height
getInitialPage(): sap.ui.core.ID
ID of the element which is the current target of the association initialPage, or null.
Returns:
sap.ui.core.ID
getPage(sId): sap.ui.core.Control
Returns the control with the given ID from the "pages" aggregation (if available).
Parameters:
stringsIdThe ID of the aggregated control to find.
Returns:
sap.ui.core.Control
getPages(): sap.ui.core.Control[]

Gets content of aggregation pages.

The content entities between which this NavContainer navigates. These can be of type sap.m.Page, sap.ui.core.View, sap.m.Carousel or any other control with fullscreen/page semantics.

These aggregated controls will receive navigation events like beforeShow, they are documented in the pseudo interface sap.m.NavContainerChild

Returns:
sap.ui.core.Control[]
getPreviousPage(): sap.ui.core.Control
Returns the previous page (the page from which the user drilled down to the current page with "to()"). Note: this is not the page which the user has seen before, but the page which is the target of the next "back()" navigation. If there is no previous page, "undefined" is returned.
Returns:
sap.ui.core.Control
Since:
1.7.1
getVisible(): boolean

Gets current value of property visible.

Whether the NavContainer is visible.

Default value is true.

Returns:
booleanValue of property visible
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

The width of the NavContainer. Can be changed when the NavContainer should not cover the whole available area.

Default value is 100%.

Returns:
sap.ui.core.CSSSizeValue of property width
indexOfPage(oPage): int
Checks for the provided sap.ui.core.Control in the aggregation pages. and returns its index if found or -1 otherwise.
Parameters:
sap.ui.core.ControloPageThe page whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
insertPage(oPage, iIndex): sap.m.NavContainer
Inserts a page into the aggregation pages.
Parameters:
sap.ui.core.ControloPagethe page to insert; if empty, nothing is inserted
intiIndexthe 0-based index the page should be inserted at; for a negative value of iIndex, the page is inserted at position 0; for a value greater than the current size of the aggregation, the page is inserted at the last position
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
insertPreviousPage(sPageId, sTransitionName?, oData?): sap.m.NavContainer

Inserts the page/control with the specified ID into the navigation history stack of the NavContainer.

This can be used for deep-linking when the user directly reached a drilldown detail page using a bookmark and then wants to navigate up in the drilldown hierarchy. Normally such a back navigation would not be possible because there is no previous page in the NavContainer's history stack.

Parameters:
stringsPageIdThe ID of the control/page/screen which is inserted into the history stack. The respective control must be aggregated by the NavContainer, otherwise this will cause an error.
stringsTransitionName?The type of the transition/animation which would have been used to navigate from the (inserted) previous page to the current page. When navigating back, the inverse animation will be applied. This parameter can be omitted; then the default is "slide" (horizontal movement from the right).
objectoData?This optional object can carry any payload data which would have been given to the inserted previous page if the user would have done a normal forward navigation to it.
Returns:
sap.m.NavContainer
Since:
1.16.1
removeAllPages(): sap.ui.core.Control[]

Removes all the controls from the aggregation pages.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.ui.core.Control[]An array of the removed elements (might be empty)
removePage(vPage): sap.ui.core.Control
Removes a page from the aggregation pages.
Parameters:
int|string|sap.ui.core.ControlvPageThe page to remove or its index or id
Returns:
sap.ui.core.ControlThe removed page or null
setAutoFocus(bAutoFocus): sap.m.NavContainer

Sets a new value for property autoFocus.

Determines whether the initial focus is set automatically on first rendering and after navigating to a new page. This is useful when on touch devices the keyboard pops out due to the focus being automatically set on an input field. If necessary the "afterShow" event can be used to focus another element.

Note: The following scenarios are possible, depending on where the focus was before navigation to a new page:

  • If autoFocus is set to true and the focus was inside the current page, the focus will be moved automatically on the new page.
  • If autoFocus is set to false and the focus was inside the current page, the focus will disappear.
  • If the focus was outside the current page, after the navigation it will remain unchanged regardless of what is set to the autoFocus property.

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

Default value is true.

Parameters:
booleanbAutoFocusNew value for property autoFocus
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
Since:
1.30
setDefaultTransitionName(sDefaultTransitionName): sap.m.NavContainer

Sets a new value for property defaultTransitionName.

The type of the transition/animation to apply when "to()" is called without defining a transition type to use. The default is "slide". Other options are: "fade", "flip" and "show" - and the names of any registered custom transitions.

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

Default value is slide.

Parameters:
stringsDefaultTransitionNameNew value for property defaultTransitionName
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
Since:
1.7.1
setHeight(sHeight): sap.m.NavContainer

Sets a new value for property height.

The height of the NavContainer. Can be changed when the NavContainer should not cover the whole available area.

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

Default value is 100%.

Parameters:
sap.ui.core.CSSSizesHeightNew value for property height
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
setInitialPage(oInitialPage): sap.m.NavContainer
Sets the associated initialPage.
Parameters:
sap.ui.core.ID|sap.ui.core.ControloInitialPageID of an element which becomes the new target of this initialPage association; alternatively, an element instance may be given
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
setVisible(bVisible): sap.m.NavContainer

Sets a new value for property visible.

Whether the NavContainer is visible.

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

Default value is true.

Parameters:
booleanbVisibleNew value for property visible
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
setWidth(sWidth): sap.m.NavContainer

Sets a new value for property width.

The width of the NavContainer. Can be changed when the NavContainer should not cover the whole available area.

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

Default value is 100%.

Parameters:
sap.ui.core.CSSSizesWidthNew value for property width
Returns:
sap.m.NavContainerReference to this in order to allow method chaining
to(sPageId, sTransitionName?, oData?, oTransitionParameters?): sap.m.NavContainer

Navigates to the next page (with drill-down semantic) with the given (or default) animation. This creates a new history item inside the NavContainer and allows going back.

Note that any modifications to the target page (like setting its title, or anything else that could cause a re-rendering) should be done BEFORE calling to(), in order to avoid unwanted side effects, e.g. related to the page animation.

Available transitions currently include "slide" (default), "fade", "flip", and "show". None of these is currently making use of any given transitionParameters.

Calling this navigation method triggers first the (cancelable) "navigate" event on the NavContainer, then the "beforeHide" pseudo event on the source page and "beforeFirstShow" (if applicable) and"beforeShow" on the target page. Later - after the transition has completed - the "afterShow" pseudo event is triggered on the target page and "afterHide" on the page which has been left. The given data object is available in the "beforeFirstShow", "beforeShow" and "afterShow" event object as "data" property.

Parameters:
stringsPageIdThe screen to which drilldown should happen. The ID or the control itself can be given.
stringsTransitionName?

The type of the transition/animation to apply. This parameter can be omitted; then the default is "slide" (horizontal movement from the right). Other options are: "fade", "flip", and "show" and the names of any registered custom transitions.

None of the standard transitions is currently making use of any given transition parameters.

objectoData?

Since version 1.7.1. This optional object can carry any payload data which should be made available to the target page. The "beforeShow" event on the target page will contain this data object as "data" property.

Use case: in scenarios where the entity triggering the navigation can or should not directly initialize the target page, it can fill this object and the target page itself (or a listener on it) can take over the initialization, using the given data.

When the "transitionParameters" object is used, this "data" object must also be given (either as object or as null) in order to have a proper parameter order.

objectoTransitionParameters?

Since version 1.7.1. This optional object can contain additional information for the transition function, like the DOM element which triggered the transition or the desired transition duration.

For a proper parameter order, the "data" parameter must be given when the "transitionParameters" parameter is used. (it can be given as "null")

NOTE: it depends on the transition function how the object should be structured and which parameters are actually used to influence the transition. The "show", "slide" and "fade" transitions do not use any parameter.

Returns:
sap.m.NavContainer