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

Save List state in VF Controller

Hi there. Does anyone have any suggestions for saving a List state of a controller?

Here's the scenario. Im trying to create a wizard like app. Page 1 has a list of Contacts (contactList)

of which a table is generated. There is a next button on page 1 that returns a pagereference to Page 2.

When a certain button is clicked on Page 2, I want to write to the database the values that were set in the contact list (contactList)

in the controller of Page 1. Is this possible - will the transient keyword help me out here?


Many thanks.


According to the "wizard" examples I have seen, if you have both pages reference the same controller, and set redirect to false your controller state should be maintained.  The potential issue you can run into is the viewstate size.  The transient keyword can assist with this.

Thanks Jim - You're always a wealth of knowledge! :)