on 04-28-2016 11:51 AM
I have made a Fiori application where in there are 2 pages . On the first page's button click it would navigate to page 2 . But when I click on the button I am getting an error Cannot read property 'setHash' of Undefined.
Below is the code of my manifest.json for routing :-
"routing": { |
"targets": {
"view1": {
"viewName": "View1",
"viewId": "V1",
"viewLevel": 1
},
"page2": {
"viewName": "Pge2",
"viewId": "V2",
"viewLevel": 2
}
},
"config": {
"routerClass": "sap.m.routing.Router",
"targetsClass": "sap.m.routing.Targets",
"viewType": "XML",
"viewPath": "QuickStartApplication.view",
"controlId": "app",
"controlAggregation": "pages",
"targetParent": "Page",
"transition": "slide",
"clearAggregation": false
},
"routes": [{
"name": "view1",
"pattern": "",
"greedy": false,
"target": ["View1"]
}, {
"name": "page2",
"pattern": "next",
"greedy": false,
"target": ["Pge2"]
}]
Can anyone help me with this?
Hi Manali,
I had the same problem. My project was started form a template in WebIDE .
In my case the solution was:
<App id="app"> |
Then sap.ui.core.UIComponent.getRouterFor(this).navTo(... worked fine.
Hope that helps.
Gabor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Evgeny,
I just followed the above steps mentioned by Gabor and it worked for me .
1. Firstly check that the view mentioned in rootView has a control App
for example , <App id="app>
...
...
</App>
I my app first page is named as View1. So its configuration in manifest.json is as shown above .
Then in manifest.json check :- "routing": { "config": { "controlId": "app",
Besides this also check the routes are defined correctly or not .
Also be sure that in Component.js you have initialized the router and also check if in the contoller you have written the getRouter function.
And if you could tell which file you want to see I can provide that file.
Hope it helps.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.