You need to sign in to do that
Don't have an account?

i want to display 10 account records with radio buttons???
Hiii all
pls help
For my requirement I want to display 10 account records with radio buttons ,
every record before should display radio button and if I selected one radio button means one contact.The contact should open in an edit page,
if I did any modifications on that record then saved that should display after saving record in detail page.
Quick Response Appriaciable..
Thanks in advance
Thanks & Regards
Arun.N
Please try the below code :
VF Page:
Class:
Here on click checkbox this will rediret to edit page.
Thanks.
All Answers
Page
Raj Vakati for Your Response,
Above code shows output like this:
but as per my requirement if I select one account record, Then that record should open as a "Edit page" and if I did any modifications in that and saved that modifications should display in detail page of that account record
Thank u
Regards
Arun
Please try the below code :
VF Page:
Class:
Here on click checkbox this will rediret to edit page.
Thanks.
Bhargavi,
How simply you resolved my issue , Its working ..
Thank you soo much..
Regards
Arun Chowdary
Below code can fullfill your requirements. Hope this will work for you.
VF Page :
<apex:page controller="DiplayRelatedContacts" id="pg">
<apex:form id="frm">
<apex:pageBlock id="pgblk" >
<apex:pageBlockTable value="{!accList}" var="ac">
<apex:column width="10px">
<input type="radio" name="group1" />
<apex:actionSupport event="onclick" action="{!dispalyContact}" ReRender="conpgblk" >
<apex:param assignTo="{!accId}" name="accname" value="{!ac.id}"/>
</apex:actionSupport>
</apex:column>
<apex:column value="{!ac.Name}" />
<apex:column value="{!ac.AccountNumber}" />
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock id="conpgblk" >
<apex:outputPanel rendered="{!conList.size == 0}">
<b> NO RELATED CONTACTS FOR THIS ACCOUNT .</b>
</apex:outputPanel>
<apex:outputPanel rendered="{!conList.size != 0}">
<apex:pageBlockTable value="{!conList}" var="con">
<apex:column value="{!con.FirstName}" />
<apex:column value="{!con.LastName}" />
</apex:pageBlockTable>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller :
public class DiplayRelatedContacts {
public List<Account> accList{get;set;}
public list<Contact> conList{get;set;}
public String accId{get;set;}
public DiplayRelatedContacts(){
accList=[SELECT Id,Name,AccountNumber FROM Account LIMIT 10];
}
public PageReference dispalyContact() {
if(accId != null)
conList=[SELECT id,FirstName,LastName FROM COntact WHERE AccountId=:accId];
return null;
}
}
Please mark this as best answer if this solves your problem.
Thank you
Ajay Dubedi