1
votes

I'm working on an XPages Mobile app using mobile controls from Extension Library.

My hope page is a menu leading to 4 different mobilePages.

I get this this is 1 XPage and we're dealing with "Virtual Pages". But is there a way to clear viewScope variables and document bindings as you go back and forth between virtual pages?

For instance. In one of my pages I ask the user for some data. 3 Fields stored in viewScope Variables. Using that I then have a button to Create a new document which gets bound to a panel and then I do things with it.

If the user hits "back" from the menu bar, to go to the Home screen and then goes back to the same page I want to clear everything and start all over.

setting resetContent= true doesn't do anything here.

My virtual page is a custom control and I tried to clear everything on beforePageLoad but that wiped it all during a manual refresh.

I tried hooking into the rendered property of the back button but that fired during a full page refresh. Possibly I could live with partial refreshes but someone might still manually refresh it.

Any way to get this ability inside the single page app mobile context?

Thanks!

2
Maybe the answer to this question can help: stackoverflow.com/questions/9806358/…Per Henrik Lausten

2 Answers

6
votes

See the following XSnippet on OpenNTF.org for your answer and a worked example - have fun! BTW: this is something we want to support on the Mobile App Page in an upcoming release - for now you can use the worked example I provide on XSnippets!

http://openntf.org/XSnippets.nsf/snippet.xsp?id=calling-server-side-jscode-during-mobile-page-transitions

2
votes

Have you tried using requestScope for the virtual page bindings? From your description, it sounds like this would be the correct scope to use.