Trouble combining global variables and "back" function

Hi all,

I’m working on a mobile prototype in which I want to start the user on a page (let’s call it a “parent” page), navigate temporarily to a page hierarchically beneath it (call it a “child” page), set a variable, then use the “back” function to return to the first page.

I need that variable to trigger a display on the parent page.

I’m able to set a global variable on the child page, but in testing when I use the “back” function to return from child to parent, Axure appears to ignore any logic associated with “onPageLoad” on the parent page. It’s as if Axure is saying “you used Back, that doesn’t count as a page load”.

Now, if I hard code a link from child to parent, then everything works as it should.

I’d like to avoid hard-coding “back” button events in the prototype, and instead use a single master “back” function - but it seems like that won’t trigger OnPageLoad events… ?

Any help would be greatly appreciated!

Hi,

Please check this demo.
step 1: create one dynamic panel (your button size and name it)
step 2: upload ur .rpfile in axshare
step 3: Insert Plugin 1: (choose End of the Head)
paste below code:
<script>
function goBack() {
window.history.back()
}
</script>
<style>
div[data-label=“btn”]{ display:none;}
</style>
step 4: Add the Plugin to Pages -> select all pages and select check box Add to new pages by default.

step 5: Insert Plugin 2: (Inside Dynamic Panels with Name: “mention your dynamic panel name”)
paste below code:
<button onclick=“goBack();”>Go Back</button>
step 6: do step 4

1 Like

Hi - Great example.

Is there anyway to over-ride the default HTML button styling here?

When I followed this example the button I had configured in my DP was over-written with the HTML button styling from the script.

Thanks

Kyle

Hi Kyle,
Please try to add below code in onpageload event.
javascript:void($(’[data-label=“mybutton”]’).css({“background-color”: “#ff0000”, “font-size”: “12px”,“font-family”:“arial”,“font-weight”:“bold”,“color”:"#ffffff",“padding”:“5px 10px”,“border”:“none”}));

I did not check this code. currently I don’t have an Axure.

I hope it will help you.
Thanks,
Vikram

Hi,

we tried to include your code but there’s one question left. How can we put a link to the back button that connects to your code? So far, we’ve named the back button as explained by you but it’s not possible to “click” it.

Thanks for your help!

data-label=“mybutton”
“mybutton” is button name. You can give your button name here.

Thank you for the tip but I am not a developer nor a hacker…
I wait for a clean solution Axure embedded…
:slight_smile:

Hello,

finally I got to integrate the “go back” button so I can use it in axshare environment. Though, how is it possible to start working with that button in the axure software again. If I re-download my edited file with the plugins from axshare there is no “go back” button functionality…

Thanks for your help