Skip to Content
1

SAPUI5 navigation using browser or android back button

May 16, 2017 at 08:35 AM

160

avatar image
Former Member

My SAPUI5 app is working fine. The navigation using the navButton is ok. But within use navigation on browser or Android back button, the app navigate though the history.

How can I disable these navigation leaving only my app's navigation?

10 |10000 characters needed characters left characters exceeded
Former Member

Hi Muhammed,

Did you find any solution to this? I have a similar requirement but I am not able to figure it out.

Regards,

Ankur

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member May 22, 2017 at 08:21 AM
0

Hi,

Disabling browser's default behavior is not a good idea, however you can prevent it by using window.history.forward() on browser.

If you are using phonegap or cordova, you can add event listener document.addEventListener("backbutton", funName, false) on deviceready.

Hope this helps.

Regards,

Aarti

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Aarti,

Can you tell how to call window.history.forward() in this case?

I mean how will I get the reference when the browser back button is clicked and then how will I trigger a function(or event) for this.

Best Regards,

Ankur

0
Former Member

Hi Ankur,

For browser: you can add some function with code "window.history.forward() in head section of the page which will prevent browser's default back button behavior.

For Device: If you are using hybrid app in Cordova/Phonegap then you can add listener for native back button of the device as per my previous comment.

Let me know if it works for you.

Regards,

Aarti Dhamat

0