+ Start a Discussion
.Net Api.Net Api 

Problem in Radio Button selection

Hi ,

        I am getting problem in radio button selection by default all the radio buttons are loading with selected can you any one can help to resolve this issue .



kranthi nagisetty

Chamil MadusankaChamil Madusanka

If you can post your code I could give better answer becuase now don't have the idea about your code. But I wiil put some sample code for radio button. Please refer the example and solve your issue. If not post your code.


Here the sample;





<apex:page controller="sampleCon">
        <apex:selectRadio value="{!country}">
            <apex:selectOptions value="{!items}"/>
            <apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
     <apex:outputPanel id="out">
          <apex:actionstatus id="status" startText="testing..."> 
             <apex:facet name="stop"> 
                  <p>You have selected:</p> 
                 <apex:outputText value="{!country}"/> 






public class sampleCon {
    String country = null;
    public PageReference test() {
        return null;
    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>(); 
        options.add(new SelectOption('US','US')); 
        options.add(new SelectOption('CANADA','Canada')); 
        options.add(new SelectOption('MEXICO','Mexico')); return options; 
    public String getCountry() {
        return country;
    public void setCountry(String country) { this.country = country; }


If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.



Chamil Madusanka