You need to sign in to do that
Don't have an account?
Pritam Patil 19
How to get multiple value of <apex:selectRadio> in <apex:repeat> ?
Hello all,
I want to get different values of <apex:selectRadio> which is in <apex:repeat>. How do I acheive this?
In debug logs I can see the following :-
06:36:53.0 (30801063)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this.OptionOne|"One"|0x54e51697
06:36:53.0 (30901056)|SYSTEM_MODE_ENTER|true
06:36:53.0 (30931204)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4
06:36:53.0 (30935083)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:44
06:36:53.0 (30944764)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this.OptionOne|"Four"|0x54e51697
06:36:53.0 (31041462)|SYSTEM_MODE_ENTER|true
06:36:53.0 (31075557)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
06:36:53.0 (31079500)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:44
06:36:53.0 (31088629)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this.OptionOne|"Three"|0x54e51697
'OptionOne' is the value passed from <apex:selectRadio>, and I want all the values that 'this.OptionOne' is showing, instead I only get the last value.
VF page:
<apex:repeat value="{!fdquestionlist}" var="fd">
<span>FeedBack Name=============></span>
<apex:outputLabel value="{!fd.Related_Feedback__r.Feedback_Name__c}" rendered="true"></apex:outputLabel>
<br />
<br />
<apex:outputField value="{!fd.Question__c}"/><br /><br />
<br />
<br />
<apex:selectRadio value="{!OptionOne}" id="SelectedRadio">
<apex:selectOption itemValue="{!fd.Option_One__c}" itemLabel="{!fd.Option_One__c}"></apex:selectOption>
<apex:selectOption itemValue="{!fd.Option_Two__c}" itemLabel="{!fd.Option_Two__c}"></apex:selectOption>
<apex:selectOption itemValue="{!fd.Option_Three__c}" itemLabel="{!fd.Option_Three__c}"></apex:selectOption>
<apex:selectOption itemValue="{!fd.Option_Four__c}" itemLabel="{!fd.Option_Four__c}"></apex:selectOption>
<apex:selectOption itemValue="{!fd.Option_Five__c}" itemLabel="{!fd.Option_Five__c}"></apex:selectOption>
</apex:selectRadio><br /><br />
</apex:repeat>
Thanks,
Pritam
I want to get different values of <apex:selectRadio> which is in <apex:repeat>. How do I acheive this?
In debug logs I can see the following :-
06:36:53.0 (30801063)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this.OptionOne|"One"|0x54e51697
06:36:53.0 (30901056)|SYSTEM_MODE_ENTER|true
06:36:53.0 (30931204)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4
06:36:53.0 (30935083)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:44
06:36:53.0 (30944764)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this.OptionOne|"Four"|0x54e51697
06:36:53.0 (31041462)|SYSTEM_MODE_ENTER|true
06:36:53.0 (31075557)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:5
06:36:53.0 (31079500)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:44
06:36:53.0 (31088629)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this.OptionOne|"Three"|0x54e51697
'OptionOne' is the value passed from <apex:selectRadio>, and I want all the values that 'this.OptionOne' is showing, instead I only get the last value.
VF page:
<apex:repeat value="{!fdquestionlist}" var="fd">
<span>FeedBack Name=============></span>
<apex:outputLabel value="{!fd.Related_Feedback__r.Feedback_Name__c}" rendered="true"></apex:outputLabel>
<br />
<br />
<apex:outputField value="{!fd.Question__c}"/><br /><br />
<br />
<br />
<apex:selectRadio value="{!OptionOne}" id="SelectedRadio">
<apex:selectOption itemValue="{!fd.Option_One__c}" itemLabel="{!fd.Option_One__c}"></apex:selectOption>
<apex:selectOption itemValue="{!fd.Option_Two__c}" itemLabel="{!fd.Option_Two__c}"></apex:selectOption>
<apex:selectOption itemValue="{!fd.Option_Three__c}" itemLabel="{!fd.Option_Three__c}"></apex:selectOption>
<apex:selectOption itemValue="{!fd.Option_Four__c}" itemLabel="{!fd.Option_Four__c}"></apex:selectOption>
<apex:selectOption itemValue="{!fd.Option_Five__c}" itemLabel="{!fd.Option_Five__c}"></apex:selectOption>
</apex:selectRadio><br /><br />
</apex:repeat>
Thanks,
Pritam
Actually I am passing the value of the SelectRadio to a variable declared in apex class named 'OptionOne'. How do I include it in the repeater ?
Thanks.
http://sfdcsrini.blogspot.com/2015/03/wrapper-class-usage-in-apex-and.html
There are many articles about using wrapper classes for this sort of thing, if this one doesn't make sense to you.