You need to sign in to do that
Don't have an account?
Problem with radio button
Hi All,
I am using Checkbox in Page Block table. I am getting data from external system by invoking a webservice and displaying it in Page Block Table. I need to replce the Checkbox with Radio Button, But when I use the Radio Button<selectRadio> tag it is getting selected by default for all the records can anyone help me out from this issue....
<apex:page StandardController="Opportunity" extensions="Sync_Page" >
<script type="text/javascript">
var selectedCheckBox;
function deSelectOthers(CheckBox){
if(CheckBox.checked){
if((CheckBox != selectedCheckBox) && (selectedCheckBox != null))
selectedCheckBox.checked = false;
}
selectedCheckBox = CheckBox;
}
</script>
<b><apex:sectionHeader description="Deal Review Details" title="Opportunity"/></b>
<apex:form id="formId">
<apex:pageBlock id="pgbId">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Submit}"/>
<apex:commandButton value="Cancel" action="{!redirect1}" />
<apex:commandButton value="Get Details" action="{!redirect}"/>
</apex:pageblockButtons>
<apex:pageMessages />
<apex:pageBlockSection title="Deal Review Details" columns="1" id="pgbsId">
<apex:pageBlockTable value="{!dealsList}" var="db" id="drDetails">
<apex:column headerValue="Select" ><apex:inputCheckbox value="{!db.Checkbox}" onclick="deSelectOthers(this)" /></apex:column>
<apex:column headerValue="Last Modified Date" value="{!db.Closedate}"/>
<apex:column headerValue="Customer Name" value="{!db.CustomerName}"/>
<apex:column headerValue="Deal Name" value="{!db.Name}"/>
<apex:column headerValue="Deal Review Phase" value="{!db.Phase}"/>
<apex:column headerValue="Deal Review Stage" value="{!db.Status}"/>
</apex:pageblockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks in advance.........
I think below code snippet will help you
Visual Force Page
Controller
Above VF page and Controller shows Campaign with some [Information Name, Start Date , End Date] with Radio Button infront of each row.
I had use inner class to create list, you can create list with some simple datastructure.
Let me know If you need any more information.
Thanks,
Bala
hi
Hi, I got the display but how can I retrieve the value in the controller once a value is selected?