Back button functionality

0
Hello community, I’m trying to figure out the best way to go about this, and I’m looking to see if you guys have come up with a solution. I’m attempting to go back from page 3, now.. depending on whether I came from page1 or page2, I want to load back to that page. Page 1 and page 2 both use the same page parameter object and are *OVERVIEW* pages They both link to page 3 a *DETAIL PAGE* On page 3, i’d like to go back to either page 1, or 2. Depending on how I got to page 3…. I’ve tried the close page function, but that doesn’t work in this case because if/when a user reloads that page, it loses the current state. The ‘close page’ functionality dies there, and you are stuck.   There is a back button (link) currently on page 3, but i’m stuck with how to implement logic to decide or know what page to go back to, depending on what page called it.. I hope I was able to convey my thoughts well enough to explain my situation. Any advice on how I should approach this?  
asked
2 answers
1

If there is no other logical way to connect the user action to the return page then create a javascript action to access the browser history and load the page in that way.

In one of the hacking sessions with other MVP’s and enthusiasts a similar function was created although never exposed to the community and I can’t remember who created this. But some use of google for a javascript script that allows for this should point you in the right direction.

answered
0

I was successfully able to implement Erwin’s suggestion. Thanks Erwin!
.backLink is a class given to the back button(link) on my page.
Using a custom JS Snippet on the page:

$(function () {
  $(".backLink").on("click", () => {
    window.history.go(-1);
  });
});

This seems to load a page the same way mendix does, without reloading a whole new instance.

answered