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(mArguments?)Fires event afterNavigate to attached listeners.
fireNavigate(mArguments?)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)
  • 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:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? 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.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.core.Control}oControlEvent.getParameters.from The page which had been shown before navigation.
{string}oControlEvent.getParameters.fromId The ID of the page which had been shown before navigation.
{sap.ui.core.Control}oControlEvent.getParameters.to The page which is now shown after navigation.
{string}oControlEvent.getParameters.toId The ID of the page which is now shown after navigation.
{boolean}oControlEvent.getParameters.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.
{boolean}oControlEvent.getParameters.isTo Whether was a forward navigation, triggered by "to()".
{boolean}oControlEvent.getParameters.isBack Whether this was a back navigation, triggered by "back()".
{boolean}oControlEvent.getParameters.isBackToTop Whether this was a navigation to the root page, triggered by "backToTop()".
{boolean}oControlEvent.getParameters.isBackToPage Whether this was a navigation to a specific page, triggered by "backToPage()".
{string}oControlEvent.getParameters.direction How 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.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.core.Control}oControlEvent.getParameters.from The page which was shown before the current navigation.
{string}oControlEvent.getParameters.fromId The ID of the page which was shown before the current navigation.
{sap.ui.core.Control}oControlEvent.getParameters.to The page which will be shown after the current navigation.
{string}oControlEvent.getParameters.toId The ID of the page which will be shown after the current navigation.
{boolean}oControlEvent.getParameters.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.
{boolean}oControlEvent.getParameters.isTo Whether this is a forward navigation, triggered by "to()".
{boolean}oControlEvent.getParameters.isBack Whether this is a back navigation, triggered by "back()".
{boolean}oControlEvent.getParameters.isBackToTop Whether this is a navigation to the root page, triggered by "backToTop()".
{boolean}oControlEvent.getParameters.isBackToPage Whether this was a navigation to a specific page, triggered by "backToPage()".
{string}oControlEvent.getParameters.direction How 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:
{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.m.NavContainer.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.NavContainer.
Returns:
{sap.ui.base.Metadata} Metadata 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:
{string}sName 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.

{object}oTo 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.

{object}oBack 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.Control}oPage the page to add; if empty, nothing is inserted
Returns:
{sap.m.NavContainer} Reference 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:
{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.m.NavContainer itself
Since:
1.7.1
Returns:
{sap.m.NavContainer} Reference to this in order to allow method chaining
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:
{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.m.NavContainer itself
Since:
1.7.1
Returns:
{sap.m.NavContainer} Reference to this in order to allow method chaining
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:
{object}oBackData? 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.

{object}oTransitionParameters? 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:
{string}sPageId The 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.
{object}oBackData? 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.

{object}oTransitionParameters? 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.

Since:
1.7.2
Returns:
{sap.m.NavContainer}
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:
{object}oBackData? 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.

{object}oTransitionParameters? 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.

Since:
1.7.1
Returns:
{sap.m.NavContainer}
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.NavContainer} Reference 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:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Since:
1.7.1
Returns:
{sap.m.NavContainer} Reference to this in order to allow method chaining
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:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Since:
1.7.1
Returns:
{sap.m.NavContainer} Reference to this in order to allow method chaining
fireAfterNavigate(mArguments?): sap.m.NavContainer
Fires event afterNavigate to attached listeners.

Expects the following event parameters:

  • from of type sap.ui.core.ControlThe page which had been shown before navigation.
  • fromId of type stringThe ID of the page which had been shown before navigation.
  • to of type sap.ui.core.ControlThe page which is now shown after navigation.
  • toId of type stringThe ID of the page which is now shown after navigation.
  • firstTime of type booleanWhether 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.
  • isTo of type booleanWhether was a forward navigation, triggered by "to()".
  • isBack of type booleanWhether this was a back navigation, triggered by "back()".
  • isBackToTop of type booleanWhether this was a navigation to the root page, triggered by "backToTop()".
  • isBackToPage of type booleanWhether this was a navigation to a specific page, triggered by "backToPage()".
  • direction of type stringHow the navigation was triggered, possible values are "to", "back", "backToPage", and "backToTop".
Parameters:
{Map}mArguments? The arguments to pass along with the event
Since:
1.7.1
Returns:
{sap.m.NavContainer} Reference to this in order to allow method chaining
fireNavigate(mArguments?): 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.

Expects the following event parameters:

  • from of type sap.ui.core.ControlThe page which was shown before the current navigation.
  • fromId of type stringThe ID of the page which was shown before the current navigation.
  • to of type sap.ui.core.ControlThe page which will be shown after the current navigation.
  • toId of type stringThe ID of the page which will be shown after the current navigation.
  • firstTime of type booleanWhether 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.
  • isTo of type booleanWhether this is a forward navigation, triggered by "to()".
  • isBack of type booleanWhether this is a back navigation, triggered by "back()".
  • isBackToTop of type booleanWhether this is a navigation to the root page, triggered by "backToTop()".
  • isBackToPage of type booleanWhether this was a navigation to a specific page, triggered by "backToPage()".
  • direction of type stringHow the navigation was triggered, possible values are "to", "back", "backToPage", and "backToTop".
Parameters:
{Map}mArguments? The arguments to pass along with the event
Since:
1.7.1
Returns:
{boolean} Whether or not to prevent the default action
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.

Default value is true.

Since:
1.30
Returns:
{boolean} Value of property autoFocus
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 a 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.

Since:
1.7.1
Returns:
{string} Value of property defaultTransitionName
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.CSSSize} Value of property height
getInitialPage(): sap.ui.core.Control
ID of the element which is the current target of the association initialPage, or null.
Returns:
{sap.ui.core.Control}
getPage(sId): sap.ui.core.Control
Returns the control with the given ID from the "pages" aggregation (if available).
Parameters:
{string}sId The 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.
Since:
1.7.1
Returns:
{sap.ui.core.Control}
getVisible(): boolean
Gets current value of property visible.

Whether the NavContainer is visible.

Default value is true.

Returns:
{boolean} Value 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.CSSSize} Value 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.Control}oPage The page whose index is looked for
Returns:
{int} The 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.Control}oPage the page to insert; if empty, nothing is inserted
{int}iIndex the 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.NavContainer} Reference 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:
{string}sPageId The 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.
{string}sTransitionName? 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).
{object}oData? 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.
Since:
1.16.1
Returns:
{sap.m.NavContainer}
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.Control}vPage The pageto remove or its index or id
Returns:
{sap.ui.core.Control} The 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.

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

Default value is true.

Parameters:
{boolean}bAutoFocus New value for property autoFocus
Since:
1.30
Returns:
{sap.m.NavContainer} Reference to this in order to allow method chaining
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:
{string}sDefaultTransitionName New value for property defaultTransitionName
Since:
1.7.1
Returns:
{sap.m.NavContainer} Reference to this in order to allow method chaining
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.CSSSize}sHeight New value for property height
Returns:
{sap.m.NavContainer} Reference to this in order to allow method chaining
setInitialPage(oInitialPage): sap.m.NavContainer
Sets the associated initialPage.
Parameters:
{sap.ui.core.Control}oInitialPage Id of an element which becomes the new target of this initialPage association; alternatively, an element instance may be given
Returns:
{sap.m.NavContainer} Reference 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:
{boolean}bVisible New value for property visible
Returns:
{sap.m.NavContainer} Reference 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.CSSSize}sWidth New value for property width
Returns:
{sap.m.NavContainer} Reference 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:
{string}sPageId The screen to which drilldown should happen. The ID or the control itself can be given.
{string}sTransitionName? 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.

{object}oData? 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.

{object}oTransitionParameters? 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}