Skip to Content

Back button not working in mobile

Hai Experts,

I have developed one SAPUI5 Application where its having 2 views, from first view to second view, its navigating through routing, but when I am trying to navigate back from view2 to view1, Its not happening in mobile. but its working perfectly in desktop.

I have used the below code for naveback.

handlegoback: function() {
window.history.go(-1);
},

Kindly help me to resolve the same.

Thanks,

Muhsin

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 10 at 08:36 AM

    Does it work if you replace the line window.history.go(-1) with the below (replace "overview" with the route name for your first view) in the handlegoback function?

    var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
    				oRouter.navTo("overview",{},true);
    Add comment
    10|10000 characters needed characters exceeded

  • May 14 at 05:41 AM

    Hi,

    The code you have written will refresh application. Please try following way in controller side.

    1.

    View code:

    <Page title="{i18n>DetailTitle}" class="sapUiFioriObjectPage" showNavButton="{device>/isPhone}" navButtonPress="handleNavButtonPress" >

    Controller Code:

    handleNavButtonPress :

    function (evt)

    {

    this.nav.back("Master");

    },

    2.View Code

    <Button icon="sap-icon://edit" press="onPress1" />

    controller Code:

    onPress1: function(oEvent){

    app.to(oDetailPage1);

    }

    With Regards,

    Siva

    Add comment
    10|10000 characters needed characters exceeded