cancel
Showing results for 
Search instead for 
Did you mean: 

Launchpad Detail View Back Button doesnt work

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

pinakipatra
Contributor
0 Kudos

Hi , u can use the method toMaster for the split app

pinakipatra
Contributor
0 Kudos

Hi silvio ,
I think  Kedar is right but in case of split app  you need to use

oApp.toDetail("PageName");


or

oApp.toMaster("PageName"); in case of master view

kedarT
Active Contributor
0 Kudos

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.