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
RCJesseRCJesse 

persisting select radio buttons and checking for selection

I have an Visual Force page where there are 3 questions that use selectRadio buttons. My issue pertains to the scenario where not all 3 questions are answered. I want the radio buttons to retain any answer that is selected. For example if you just answer one of the 3 questions my submit button calls a controller function to check to make sure that all 3 questions are answered. If not a tag is set so that a line is rendered to ask that they fill all the questions. But then any buttons selected are cleared out. 

 

Any way to maintain those values? If in my submit function i do save the values entered into the Object and update it can I refresh the page then and have those buttons show as selected?  Doing that with selectLists or text fields seems to be easy/automatic but not radio buttons because i am just generating the options list from scratch for the questions. 

Best Answer chosen by Admin (Salesforce Developers) 
RCJesseRCJesse
Thanks for the link Shikibu. Wasn't quiet what i was looking for but put me on a path to my solution. Basically I was not maintaining a copy of the values in my controller itself, once i did that and gave them each their own get set methods it all worked out. 

All Answers

ShikibuShikibu
Have a look at this thread.
RCJesseRCJesse
Thanks for the link Shikibu. Wasn't quiet what i was looking for but put me on a path to my solution. Basically I was not maintaining a copy of the values in my controller itself, once i did that and gave them each their own get set methods it all worked out. 
This was selected as the best answer