You need to sign in to do that
Don't have an account?
sweety kutti
I want to select radio button inside apex:repeat by using input not using apex:selectRadio tag.
I want to select radio button inside apex:repeat by using input not using apex:selectRadio tag...Can anyone suggest...Here is my code..
I am not able to display the table with corresponding radio button record values on click of radio button...Please help me...Its an urgent task
<apex:outputPanel id="pnl" rendered="{!showResult}">
<br/>
<div class="slds-p-horizontal--medium" >
<div style="color:white; background-color:#B0C4DE; height:30px; border-width:2px 0 0; border-style:solid; border-color:#00008B" class="slds-p-left--medium">
<h2 class="slds-text-title slds-p-top--xx-small"><strong>Injured Worker-Search Results</strong></h2>
</div></div>
<div class="slds-p-around--medium">
<div class="slds-card">
<div class="slds-card__body">
<table id="Search Results" class="slds-table slds-table--bordered slds-table--cell-buffer">
<thead style="width:100%">
<tr>
<th scope="col"><b>Select</b></th>
<th scope="col"><center><b>First Name</b></center></th>
<th scope="col"><center><b>Last Name</b></center></th>
<th style="font-size:14px;color:#000000;" scope="col"><center><b>Birth Date</b></center></th>
</tr>
</thead>
<tbody >
<!-- READ OUT DATA -->
<apex:repeat value="{!accountList}" var="acclist">
<tr >
<td scope="row" data-label="Select">
<input type="radio" name="<strong>selectRadio</strong>" id= "radio" onclick="radioSearch()" reRender="frm1" status="actStatus" ></input>
<apex:param value="{!acclist.id}" name="ID" />
<!-- <apex:selectRadio>
<apex:selectOptions value="{!ID}" >
</apex:selectOptions>
<apex:actionSupport event="onClick" action="{!selectedPerson}" ></apex:actionSupport>
</apex:selectRadio> -->
</td>
<td scope="row" data-label="First Name"><center>{!acclist.FirstName}</center></td>
<td scope="row" data-label="Last Name"><center>{!acclist.LastName}</center></td>
<td scope="row" data-label="Birth Date"><center>{!acclist.PersonBirthdate}</center></td>
</tr>
</apex:repeat>
</tbody>
</table>
</div>
</div>
</div>
</apex:outputPanel>
<apex:actionFunction name="selectionRadio" action="{!selectedPerson}" reRender="frm1,pnl" status="actStatus">
</apex:actionFunction>
I am not able to display the table with corresponding radio button record values on click of radio button...Please help me...Its an urgent task
<apex:outputPanel id="pnl" rendered="{!showResult}">
<br/>
<div class="slds-p-horizontal--medium" >
<div style="color:white; background-color:#B0C4DE; height:30px; border-width:2px 0 0; border-style:solid; border-color:#00008B" class="slds-p-left--medium">
<h2 class="slds-text-title slds-p-top--xx-small"><strong>Injured Worker-Search Results</strong></h2>
</div></div>
<div class="slds-p-around--medium">
<div class="slds-card">
<div class="slds-card__body">
<table id="Search Results" class="slds-table slds-table--bordered slds-table--cell-buffer">
<thead style="width:100%">
<tr>
<th scope="col"><b>Select</b></th>
<th scope="col"><center><b>First Name</b></center></th>
<th scope="col"><center><b>Last Name</b></center></th>
<th style="font-size:14px;color:#000000;" scope="col"><center><b>Birth Date</b></center></th>
</tr>
</thead>
<tbody >
<!-- READ OUT DATA -->
<apex:repeat value="{!accountList}" var="acclist">
<tr >
<td scope="row" data-label="Select">
<input type="radio" name="<strong>selectRadio</strong>" id= "radio" onclick="radioSearch()" reRender="frm1" status="actStatus" ></input>
<apex:param value="{!acclist.id}" name="ID" />
<!-- <apex:selectRadio>
<apex:selectOptions value="{!ID}" >
</apex:selectOptions>
<apex:actionSupport event="onClick" action="{!selectedPerson}" ></apex:actionSupport>
</apex:selectRadio> -->
</td>
<td scope="row" data-label="First Name"><center>{!acclist.FirstName}</center></td>
<td scope="row" data-label="Last Name"><center>{!acclist.LastName}</center></td>
<td scope="row" data-label="Birth Date"><center>{!acclist.PersonBirthdate}</center></td>
</tr>
</apex:repeat>
</tbody>
</table>
</div>
</div>
</div>
</apex:outputPanel>
<apex:actionFunction name="selectionRadio" action="{!selectedPerson}" reRender="frm1,pnl" status="actStatus">
</apex:actionFunction>
You can create a JS method that capture onclick event on radio buttons in loop and populate a hidden textbox with selected ID.
If you're satisfied with the answers provided, please don't forget to select a Best Answer.
Thanks!
You can take example of my code and convert it to table instead of pageblocksection :
You can get the value of selected account in variable accountId in controller function selectedPerson [Create accountId variable in controller ]
Thanks