cancel
Showing results for 
Search instead for 
Did you mean: 

Browser back button in UI5 applications

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Nadav

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

0 Kudos

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.

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

former_member182372
Active Contributor
0 Kudos

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

kedarT
Active Contributor
0 Kudos

Hi Nadav,

Trying using this:

url = window.document.referrer;

window.location.assign(url);


Hope this helps.