Skip to Content
avatar image
Former Member

SAPUI5 navigation using browser or android back button

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?

Add comment
10|10000 characters needed 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

  • Get RSS Feed

1 Answer

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

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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