function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nobodynobody 

how to implement a selectcheckbox in a datatable column

Hi,
 
I am trying to get dabatable with a column with checkboxes which should decide which row to pick from the data table; but I am always running in problems, because the checkboxes are created for each row, so i couldnt manage to get the value of  the checkbox which is selected:
 

<apex:dataTable value="{!ent}" var="contact" cellPadding="4" border="1" align="center">

<apex:column>

<apex:selectRadio value="{!which}">

<apex:facet name="header">Ent_ID</apex:facet>

<apex:selectOption itemValue="{!contact.name}">{!contact.name}</apex:selectOption>

</apex:selectRadio>

</apex:column>

 

Is there a way to create one checkbox in a column. If I put the the selectRadio tags out of the column tags nothing is displayed in the column.

 

Thanks in advance.

PallavPallav
Hi,
I would like to let you know that I have implemented the checkbox in the manner given below, hope this will give you some idea of it:-

<apex:column>
<apex:facet name="header">&nbsp;</apex:facet>
<input type="checkbox" value="{!account.id}" id="{!account.name}" onclick="selectvale(this.value)"/>
</apex:column>

regards
Pallav
DS777DS777
How do you retireive the checked account id in controller
Manoj kumar.ax391Manoj kumar.ax391
Hi I am stuck up with a similar problem too. Did you find out how to read these selected checkboxes in the controller?
VarunCVarunC
Yeah mee too .. :( . plz help