+ Start a Discussion
vamsovamso 

unable to develop code for radiobuttons

Hi All,

 

i am unable to develop visualforce page and controller for the below form

problem

 

out of 4 radio buttons only one can be selected and based on the selection i should get the

dropdown list values in the controller

 

can some one please help me i am tired of doing it for last 4 days

please help me

Best Answer chosen by Admin (Salesforce Developers) 
Chamil MadusankaChamil Madusanka

Hi,

 

 

<apex:page controller="currencySymbol">
  <apex:form >
      <apex:selectRadio >      
          <apex:selectOption id="radioOne" itemLabel="Radio One" itemValue="One"></apex:selectOption>
          <apex:selectOption id="radioTwo" itemLabel="Radio Two" itemValue="Two"></apex:selectOption>
          <apex:selectOption id="radioThree" itemLabel="Radio Three" itemValue="Three"></apex:selectOption>
          <apex:selectOption id="radioFour" itemLabel="Radio Four" itemValue="Four"></apex:selectOption>
          <apex:selectOption id="radioFive" itemLabel="Radio Five" itemValue="Five"></apex:selectOption>
      </apex:selectRadio>
  </apex:form>
</apex:page>

 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.

 

All Answers

Shashikant SharmaShashikant Sharma

No radio options in available in apex component , you can use check box list and write java script in a way that behavior is like radio options or you can always use html radio option also and for binding its value to some property you can use an apex hidden whic is binded to some property in class and copy radio selection to hidden.

Chamil MadusankaChamil Madusanka

Hi,

 

 

<apex:page controller="currencySymbol">
  <apex:form >
      <apex:selectRadio >      
          <apex:selectOption id="radioOne" itemLabel="Radio One" itemValue="One"></apex:selectOption>
          <apex:selectOption id="radioTwo" itemLabel="Radio Two" itemValue="Two"></apex:selectOption>
          <apex:selectOption id="radioThree" itemLabel="Radio Three" itemValue="Three"></apex:selectOption>
          <apex:selectOption id="radioFour" itemLabel="Radio Four" itemValue="Four"></apex:selectOption>
          <apex:selectOption id="radioFive" itemLabel="Radio Five" itemValue="Five"></apex:selectOption>
      </apex:selectRadio>
  </apex:form>
</apex:page>

 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.

 

This was selected as the best answer