Skip to Content
author's profile photo Former Member
Former Member

Browser back button in UI5 applications

Hi,

Is there a way to support the browser's back button in UI5 applications?

Meaning, when the hash changes as I route between views, browser's back button will take me through the previous hash entries (and not to the previous HTML page, disregarding the hash, as it does now).

Thank you

Nadav

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Mar 04, 2015 at 07:16 PM

    I am not sure what you mean.

    Like one of the apps has up and down buttons to navigate through details of search results

    like

    index.html#/detail/00008827 -> index.html#/detail/00008826 -> index.html#/detail/00008820

    navigation is done via that._oRouter.navTo("detail", { RecNo: oObject.RecNo });

    and when I click Back I go from index.html#/detail/00008820 to index.html#/detail/00008826 and then to index.html#/detail/00008827

    so Back button technically does what are you describing if you use router.navTo

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 04, 2015 at 04:09 PM

    Hi Nadav,

    Trying using this:

    url = window.document.referrer;

    window.location.assign(url);


    Hope this helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 05, 2015 at 09:52 AM

    Hey Nadan,

    if you would like to navigate through different pages (page1 -> page2 -> page3 -> page2) of your app, you should use the routing of ui5.

    For this, see the blog post below. This post helped me a lot.

    Get started with SAPUI5 and Routing

    Note: This will only work with full-screen pages of your app, not with Master-Detail pages.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 05, 2015 at 01:17 PM

    Hi Nadav

    Try history.back() method it's works like browser button 'Back' else you should use routing.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.