SAPUI5 mobile Router
. The difference to the sap.ui.core.routing.Router are the viewLevel
, transition
, and transitionParameters
properties that you can specify in every Route or Target created by this router.
Constructor for a new sap.m.routing.Router
. See sap.ui.core.routing.Router
for the constructor arguments.
new sap.m.routing.Router(oRoutes?, oConfig?, oOwner?, oTargetsConfig?)
Param | Type | Default Value | Description |
---|---|---|---|
oRoutes? | object object[] | may contain many Route configurations as sap.ui.core.routing.Route#constructor. 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" }, //Will create a route for a nested component with the prefix 'componentPrefix' { pattern: "componentPattern", name: "componentRoute", target: [ { name: "subComponent", prefix: "componentPrefix" } ] } ] 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" }, //Will create a route for a nested component with the prefix 'componentPrefix' componentRoute{ pattern: "componentPattern", target: [ { name: "subComponent", prefix: "componentPrefix" } ] } }The values that may be provided are the same as in sap.ui.core.routing.Route#constructor |
|
oConfig? | object | Default values for route configuration - also takes the same parameters as sap.ui.core.routing.Target#constructor.
The targets look like this: { xmlTarget : { ... }, jsTarget : { viewType : "JS" ... }, componentTarget: { type: "Component", name: "subComponent", id: "mySubComponent", options: { // the Component configuration: manifest: true ... }, controlId: "myRootView", controlAggregation: "content" } }Then the effective config will look like this: { xmlTarget : { viewType : "XML" ... }, jsTarget : { viewType : "JS" ... }, componentTarget: { type: "Component", name: "subComponent", id: "mySubComponent", options: { // the Component configuration: manifest: true ... }, controlId: "myRootView", controlAggregation: "content" } } 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. |
|
async? | boolean | false | @since 1.34. Whether the views which are loaded within this router instance asyncly. |
oOwner? | sap.ui.core.UIComponent | the Component of all the views that will be created by this Router, |
|
oTargetsConfig? | object | the target configuration, see sap.m.routing.Targets#constructor documentation (the options object).
|
Method | Description |
---|---|
sap.m.routing.Router.extend |
Creates a new subclass of class sap.m.routing.Router with name
|
sap.m.routing.Router.getMetadata |
Returns a metadata object for class sap.m.routing.Router. |
getTargetHandler |
Returns the TargetHandler instance. |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |