Hi I have following code for visual force and apex controller which renders the information about the 4 quarters in current year.. customer visit the page and select the check boxes and submit their preference.
It renders the page but what customer want is whenever they visit the page again the previously selected choices should be shown to them.
Visual Force to display Checkboxes
<apex:selectCheckboxes value="{!RegPeriod}" required="true">
<apex:selectOptions value="{!RegistrationPeriod}"/>
</apex:selectCheckboxes>
Apex Controller:
public List<String> regPeriod = new List<String>();
public List<String> getRegPeriod(){
return regPeriod;
}
public void setRegPeriod(List<String> RegPrd){
regPeriod.addAll(RegPrd);
}
public List<SelectOption> RegistrationPeriod {
get {
List<SelectOption> listOfRegPeriod = new List<SelectOption>();
for(S_Period__c certiPeriod : listPeriod) {
listOfRegPeriod.add(new SelectOption( certiPeriod.Id, certiPeriod.Name));
}
return listOfRegPeriod;
}
set;
}
I am fetching the periods (Quarters) from one of custom object and When submitted, the values for checkboxes are saved in another custom object