+ Start a Discussion
cignuscignus 

Adding a radio button column to table data

Hi

 

I want to make a page with a table of some data. I want to have a radio button column which has a radio button beside each line.

I tried using selectRadio with selectOption but the resulting radion buttons had deifferent names, so when I select one of them the other ones do not becime unseleeccted

 

Cheers

Best Answer chosen by Admin (Salesforce Developers) 
cignuscignus

I used an html input

 

<column...

<input type="radio" name="radioName" value="{!p.id}" />

</column> 

 

p is the table variable name

 

its works fine and I get the value in controller using ApexPages.currentPage().getParameters().get('radioName');

All Answers

bob_buzzardbob_buzzard

I'm not sure how you could do this without javascript using a table, as the radio button input would somehow have to span multiple rows and contain all the data from those rows.  If you can go the javascript route, you can simple unselect all the other radion buttons when the user clicks one.

cignuscignus

I used an html input

 

<column...

<input type="radio" name="radioName" value="{!p.id}" />

</column> 

 

p is the table variable name

 

its works fine and I get the value in controller using ApexPages.currentPage().getParameters().get('radioName');

This was selected as the best answer