cancel
Showing results for 
Search instead for 
Did you mean: 

Buttons in Fiori Templates do not work

Former Member
0 Kudos

Hello,

I have used several Fiori Templates (Master-Detail App for example) and have noticed, that the backwards navigation buttons are not working.

Is this meant to be implemented by us when using the template or might this be a bug?

Thanks in advance

Laura

Accepted Solutions (0)

Answers (2)

Answers (2)

sureshkrishna
Discoverer
0 Kudos

Hai Laura Jungwirth,

I had written a code for that, you may need a simple change in your code.

Change your if() condition as followed.

  var oHistory = sap.ui.core.routing.History.getInstance().getPreviousHash(),

  oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");

  if (sPreviousHash !== undefined || !oCrossAppNavigator.isInitialNavigation()) {

       history.go(-1);

  } else {

       oCrossAppNavigator.toExternal({

       target: {shellHash: "#Shell-home"}

       );

  }

Try it once.

Still If you are not getting please inform me.

saurabh_vakil
Active Contributor
0 Kudos

I have created Master-Detail app from Web IDE and deployed it to the Cloud, then integrated it with the cloud launchpad. Then when I access the app from the cloud launchpad and click on the back button in the header of the master view it navigates back to the launchpad homepage.

Even when I run the master-detail app as a web app from Web IDE the back button works fine.

In the Master.controller.js file the onNavBack function has the below code (generated by the framework), verify if the same code is present in your case:


var oHistory = sap.ui.core.routing.History.getInstance(),

sPreviousHash = oHistory.getPreviousHash(),

oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");

if (sPreviousHash !== undefined) {

// The history contains a previous entry

history.go(-1);

} else {

// Navigate back to FLP home

oCrossAppNavigator.toExternal({

target : {shellHash: "#Shell-home"}

});

}