on 01-20-2015 9:13 AM
Hello everyone,
we deployed an app into the fiori launchpad and the nav (back) -button of the detail view doesnt work. The logic for the nav-button is auto implemented by the web ide and looks like this
handleNavButtonPress: function() {
console.log("nav button pressed");
var history = sap.ui.core.routing.History.getInstance();
var router = sap.ui.core.UIComponent.getRouterFor(this);
var url = router.getURL("master", {});
var direction = history.getDirection(url);
if (direction === "Backwards") {
/* eslint-disable */
window.history.go(-1);
console.log("history -1");
/* eslint-enable */
} else {
console.log("backToMaster");
router.navTo("master", {}, true); // otherwise we go backwards with a forward history
}
}
First time we press the button line 9 in the code is called and nothing happens. There is no switch to the master view. After that line fourteen is called an nothing happens. The router is also autogenerated by the webide an looks like this:
routing: {
config: {
viewType : "XML",
viewPath: "TourApp.view", // common prefix
targetAggregation: "detailPages",
clearTarget: false
},
routes:
[{
pattern: "",
name : "master",
view : "Master",
targetAggregation : "masterPages",
preservePageInSplitContainer : true,
targetControl: "fioriContent",
subroutes : [
{
pattern : "Detail/{contextPath}", // will be the url and from has to be provided in the data
view : "Detail",
name : "Detail" // name used for listening or navigating to this route
}]
}]
}
Can anyone help?
Thanks,
Silvio.
In our case the reason for this seemed to be outdated launchpad because of an outdated underlaying SAP System. After an update navigation works fine.
Thanks for all the kind answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kedar, Hello Pinaki,
thanks for your answers but they want help so far. I'm now able to descript the problem a little bit closer. It seems that the URL is change in correct way by the navigation but there the master view is not rendered. Please take a look at the pictures below:
1. Initial opening of the app running inside the lauchpad. IPhone Simulation is on. Behavior in Fiori Client on real IPhone is the same.
2. I select an item on the list and the view swaps to detail. URL changes. Everthing fine so far.
3. Now I press the back button and the URL changes in a correct way, but there is now rendering of the master view.
I hope you can help. We are out of ideas.
Thanks in advance,
Silvio.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Silvio,
How about using below code in handleNavButtonPress:
oApp = sap.ui.getCore().byId("SplitApp"); | ||||
oApp.backToPage("MasterView"); |
Where oApp is the instance of the splitapp which might have a different id.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.