on 10-23-2018 2:23 PM
Hi,
I am looking for a way to choose which route my component.js takes first.
My app contains 3 Master/Detail-Views inside 1 SplitApp.
So I have 3 routes: MasterA -> DetailA, MasterB ->DetailB and MasterC->DetailC
How or where can I tell my app which route it takes first? Right now it takes the route, which is first declared in my manifest.json.
"pattern": "", should be unique, I am not using subroute.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually it depends on the pattern..
Usually when u run a fiori app, it goes and checks in the routes that u defined and will pick the route which has the pattern as empty. Because fiori app runs first time with empty pattern. so where ever u give the pattern as ' pattern:"" ' that particular rout will be pickd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The thing is, that I want to call the first route dynamically. Depending on a parameter which starts the app.
More accurate: I want to do 3 tiles for my app. Each tile gives another parameter (App, User, Scenario) to my app. Inside my app I will then decide which route it shall take.
My assumption is, that I have to read the input parameter in my component.js. And then I have to "call the route".
Super.
Actually I am not sure how to default a particular route(even if it is possible or not). But you can do one thing, call navTo method in component by passing your respective route name and parameters.
e.g.,
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo("detail", {
invoicePath: oItem.getBindingContext("invoice").getPath().substr(1)
});
yes, you define your route based on the url pattern.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you give me an example?
My routes are right now like this:
"routes": [ {
"pattern": "",
"name": "MasterUsers",
"target": [
"MasterUsers"
],
"subroutes": [{
"pattern": "DetailUsers/{Username}",
"name": "DetailUsers",
"target": [
"DetailUsers"
]
}]
},{
"pattern": "",
"name": "MasterApplications",
"target": [
"MasterApplications"
],
"subroutes": [{
"pattern": "DetailApplications/{Application}",
"name": "DetailApplications",
"target": [
"DetailApplications"
]
}]
}, {
"pattern": "",
"name": "MasterScenarios",
"target": [
"MasterScenarios"
],
"subroutes": [{
"pattern": "DetailScenarios/{Scenario}",
"name": "DetailScenarios",
"target": [
"DetailScenarios"
]
}]
}]
And my app always starts with "MasterUsers".
in the route you defined.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.