This class will attach to the Events of a provided router and add the views created by it to a sap.m.SplitContainer or a sap.m.NavContainer Control, if this is the target control of the route. If the targetControl is no sap.m.SplitContainer or a sap.m.NavContainer, It will only close the dialogs, according to the property value. When a navigation is triggered, this class will try to determine the transition of the pages based on the history. Eg: if a user presses browser back, it will show a backwards animation. The navigation on the container takes place in the RoutePatternMatched event of the Router. If you register on the RouteMatched event of the Router, the visual navigation did not take place yet. Since it is hard to detect if a user has pressed browser back, this transitions will not be reliable, for example if someone bookmarked a detail page, and wants to navigate to a masterPage. If you want this case to always show a backwards transition, you should specify a "viewLevel" property on your Route. The viewLevel has to be an integer. The Master should have a lower number than the detail. These levels should represent the user process of your application and they do not have to match the container structure of your Routes. If the user navigates between views with the same viewLevel, the history is asked for the direction. You can specify a property "transition" in a route to define which transition will be applied when navigating. If it is not defined, the nav container will take its default transition. You can also specify "transitionParameters" on a Route, to give the transition parameters. preservePageInSplitContainer is deprecated since 1.28 since Targets make this parameter obsolete. If you want to preserve the current view when navigating, but you want to navigate to it when nothing is displayed in the navContainer, you can set preservePageInSplitContainer = true When the route that has this flag directly matches the pattern, the view will still be switched by the splitContainer.
Deprecated API:Since 1.28 use sap.m.routing.Router or sap.m.routing.Targets instead. The functionality of the routematched handler is built in into these two classes, there is no need to create this anymore.
Method Summary
sap.m.routing.RouteMatchedHandler.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.routing.RouteMatchedHandler with name sClassName
and enriches it with the information contained in oClassInfo
. destroy()Removes the routeMatchedHandler from the Router Constructor Detail
new sap.m.routing.RouteMatchedHandler(router, closeDialogs)
Instantiates a RouteMatchedHandler.
Parameters:
{sap.ui.core.routing.Router} | router | A router that creates views |
{boolean} | closeDialogs | the default is true - will close all open dialogs before navigating, if set to true. If set to false it will just navigate without closing dialogs. |
- Deprecated:
- Since 1.28 use sap.m.routing.Router or sap.m.routing.Targets instead. The functionality of the routematched handler is built in into these two classes, there is no need to create this anymore.
- See:
- sap.m.NavContainer
Method Detail
sap.m.routing.RouteMatchedHandler.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.routing.RouteMatchedHandler with name
sClassName
and enriches it with the information contained in
oClassInfo
.
oClassInfo
might contain the same kind of information as described in Object.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 |
Returns a metadata object for class sap.m.routing.RouteMatchedHandler.
Returns:
Removes the routeMatchedHandler from the Router
Returns:
getCloseDialogs(): boolean
Gets if a navigation should close dialogs
Returns:
{boolean} | a flag indication if dialogs will be closed |
Sets if a navigation should close dialogs
Parameters:
{boolean} | bCloseDialogs | close dialogs if true |
Returns: