Skip to Content
0

Back button not working in mobile

May 10 at 07:08 AM

31

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

saurabh vakil May 10 at 08:36 AM
0

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);
Share
10 |10000 characters needed characters left characters exceeded
sivakumar M May 14 at 05:41 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded