Persist page state

0
Hi I would like to persist the page state, it is very irritating when the client decides to reload or your on mobile and you scroll up and the entire thing reloads. I’m using deeplinks to manage this and some javascript in conjunction with window.history and some mx.ui.contentform extension to handle it   There are two issues: non presistable retrieval and page state. How can I get at an np if theres no association to traverse to it and what are the possibilities for saving and restoring the state of widgets on the page (e.g. template grid offset etc.)? Thanks
asked
2 answers
1

Hi,

What if you messed around with the window on before unload event and then use the client api to reload the page. There is a function called 

mx.reloadWithState()

it was mentioned in this question:

https://forum.mendix.com/link/questions/91821

 

Then you can use the html snippet to add something like this to the page (haven’t tested this):

 window.onbeforeunload = function(event)
    {
        mx.reloadwithstate();
    };

 

Try to catch the reload event and trigger your own reload. 

 

Hope this helps!

answered
0

You might consider associating an np helper entity to the session entity, storing the desired values on the helper, and then retrieve the helper as needed via the session.

answered