+ Start a Discussion
mac adminmac admin 

Losing previous pages data when current page is refreshed

Hi all,
I'm losing the previous pages data when the current vfpage is reloaded/refreshed. In Force.com sites I have created 4 vfpages with a single controller. I'm redirecting the page with redirection method and In the last page I'm saving the data.

Can anyone help me over here.

Thanks in advance.

Regards,
mac.
Ashish DevAshish Dev
This is standard behavior because refreshing a visualforce page will run in new context for the user.
You have 2 options.
1) Show a dialogue box and confirm from user if he wants to navigate away from current page.
2) store the data in browser storage using HTML5 api and when data is available fill fields on page or JS vars with stored values.