Hi there,

I am building a header with a back button.  The back button needs to be set when you place the header in the application.  I know that external urls can be used to get what I want, but it is too "hardcoded" for my liking.  What I would like to find out is whether there is a way for me to achieve this kind of input for the destication in my variable.

I am currenly working with an input parameter that is set by the page as a "CameFrom" url which gets set by a getBookmarkableURL() value.  The issue with this is that the variable can get lost in a refresh and thus causes the back button not to work.

Hi, 

Do you want this back button to work just like browser back?

If so, I have the solution that can help you.

Edit: I just created this component, see if it helps.
On my screens, I use the webblock to go back, where it returns based on my browser's history.

https://www.outsystems.com/forge/Component_Overview.aspx?ProjectId=5586



Hi Bernardo,

Thanks for the reply and building a component, much appreciated.

I have had a look at similar solutions, but the problem is that going back to the cached version of the previous page does not refresh the preparation, therefore my navigating back to the previous page.



Tjaart Swanepoel wrote:

Hi Bernardo,

Thanks for the reply and building a component, much appreciated.

I have had a look at similar solutions, but the problem is that going back to the cached version of the previous page does not refresh the preparation, therefore my navigating back to the previous page.




You could use JavaScript to force the page to re-run the preparation...we have had a similar problem, and use some code to detect if the browser back button has been clicked. Of course, you would need to change the code to know whether your 'header back button' has been pressed.

"<script>
window.onpageshow = function(event) {
if(!!window.performance && window.performance.navigation.type === 2){
    console.log('Reloading');
    window.location.reload();
};
}</script>"

Hopefully this might help a little.