Class sap.m.routing.RouterModule: sap/m/routing/Router
Since: 1.28.1.
Constructor Summary
new sap.m.routing.Router(oRoutes?, oConfig?, oOwner?, oTargetsConfig?)Instantiates a SAPUI5 mobile Router see sap.ui.core.routing.Router for the constructor arguments The difference to the sap.ui.core.routing.Router are the properties viewLevel, transition and transitionParameters you can specify in every Route or Target created by this router.
Events borrowed from class sap.ui.core.routing.Router
Method Summary
sap.m.routing.Router.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.routing.Router with name
sClassName
and enriches it with the information contained in oClassInfo
.Methods borrowed from class sap.ui.core.routing.Router
addRoute, attachBypassed, attachRouteMatched, attachRoutePatternMatched, attachViewCreated, destroy, detachBypassed, detachRouteMatched, detachRoutePatternMatched, detachViewCreated, fireBypassed, fireRouteMatched, fireRoutePatternMatched, fireViewCreated, getRoute, getTargets, getURL, getView, getViews, initialize, navTo, parse, register, setView, stop
Methods borrowed from class sap.ui.base.EventProvider
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.m.routing.Router(oRoutes?, oConfig?, oOwner?, oTargetsConfig?)
Instantiates a SAPUI5 mobile Router see sap.ui.core.routing.Router for the constructor arguments The difference to the sap.ui.core.routing.Router are the properties viewLevel, transition and transitionParameters you can specify in every Route or Target created by this router.
Parameters:
{object|object[]} | oRoutes? | may contain many Route configurations as sap.ui.core.routing.Route. Each of the routes contained in the array/object will be added to the router. One way of defining routes is an array: [ //Will create a route called 'firstRouter' you can later use this name in navTo to navigate to this route { name: "firstRoute" pattern : "usefulPattern" }, //Will create a route called 'anotherRoute' { name: "anotherRoute" pattern : "anotherPattern" } ] The alternative way of defining routes is an Object. { //Will create a route called 'firstRouter' you can later use this name in navTo to navigate to this route firstRoute : { pattern : "usefulPattern" }, //Will create a route called 'anotherRoute' anotherRoute : { pattern : "anotherPattern" } }The values that may be provided are the same as in sap.ui.core.routing.Route |
{object} | oConfig? | Default values for route configuration - also takes the same parameters as sap.ui.core.routing.Target. This config will be used for routes and for targets, used in the router Eg: if the config object specifies :
The targets look like this: { xmlTarget : { ... }, jsTarget : { viewType : "JS" ... } }Then the effective config will look like this: { xmlTarget : { viewType : "XML" ... }, jsTarget : { viewType : "JS" ... } } Since the xmlTarget does not specify its viewType, XML is taken from the config object. The jsTarget is specifying it, so the viewType will be JS. |
{string|string[]} | oConfig.bypassed.target? | One or multiple names of targets that will be displayed, if no route of the router is matched. A typical use case is a not found page. The current hash will be passed to the display event of the target. Example:
|
{boolean} | oConfig.async? | @since 1.34. Whether the views which are loaded within this router instance asyncly. The default value is set to false. |
{sap.ui.core.UIComponent} | oOwner? | the Component of all the views that will be created by this Router, will get forwarded to the sap.ui.core.routing.Views#contructor. If you are using the componentMetadata to define your routes you should skip this parameter. |
{object} | oTargetsConfig? | the target configuration, see sap.m.routing.Targets documentation (the options object). You should use Targets to create and display views. The route should only contain routing relevant properties. Example:
|
Method Detail
sap.m.routing.Router.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.routing.Router 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.routing.Router.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.routing.Router.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.routing.Router.
Returns:
{sap.ui.base.Metadata} | Metadata object describing this class |
getTargetHandler(): sap.m.routing.TargetHandler
Returns the TargetHandler instance.
Returns:
{sap.m.routing.TargetHandler} | the TargetHandler instance |