function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC coderSFDC coder 

Retain values on VF page after navigation

Hello,

I have a VF page say for eg: Page1 ,a text field T1 and a custom button btn1.
-User enters some text in T1 and navigates away by clicking on button btn1
-There after user is redirectted to Page Page2 and after he clicks on button btn2
-he again comes back to Page Page1.

Now the challenge is when he comes back to Page1, the text he entered in textfield T1 is lost. So how do i reatain this value for the end user?

I have separate controller for page2.So is that possible to retain such values even if my pages dont share the same controller?
Also i cant use passing params through url,since in my real scenario i have to deal with lists instead of a text field,

Any help would be highly appreciated
Thanks..
Pradeep Kumar L.GPradeep Kumar L.G
You can make use of single controller and two VF page and in pageReference use setredirect=false, this will help what your are looking for.

Thanks
Pradeep Kumar L.G
SantoshChitalkarSantoshChitalkar
Hi, 

Check if Following approach works for you - 
1) create a new field in sf for page1 text field T1 and bind this field with page1's T1 field.
2) insert/update T1 into SF on btn1 click.
3) because you have inserted T1 and you bind it with SF field, it will automatically populate when you go back to Page1 from page2.

Regards,
Santosh Chitalkar