+ 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! :)