Hi Aman
VF and Controller code is mentioned below
<apex:page Controller=”ContactCustomController” >
<apex:pageBlock title=”contact List”>
<apex:form >
<apex:pageBlockTable value=”{!contacts}” var=”con”>
<apex:column headerValue=” Name” value=”{!con.Name}”/>
<apex:column headerValue=”Select”>
<input type=”radio” name=”selectRadio” id=”radio”>
<apex:actionSupport event=”onclick” action=”{!goToEdit}” ><br/> <apex:param name=”id” value=”{!con.id}”/>
</apex:actionSupport>
</input>
</apex:column>
</apex:pageBlockTable>
</apex:form>
<apex:pageBlockButtons >
<apex:form >
<apex:commandButton value=” Go to edit page” action=”{!goToEdit}”/>
</apex:form>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:page>
Controller:
public class ContactCustomController {
Id Idvalue;
Contact con;
List<Contact> contacts=[SELECT Name, Id FROM contact];
List<account> accs=[SELECT Name FROM Account ];
List<Hospital__c> hosps=[SELECT Name FROM Hospital__c ];
public List<Contact> getContacts(){
return contacts;
}
public List<Account> getaccs(){
return accs;
}
public List<Hospital__c> gethosps(){
return hosps;
}
public PageReference goToEdit(){
System.debug(‘Inside go to edit’);
Idvalue = ApexPages.currentPage().getParameters().get(‘id’);
system.debug(‘Id value=’+Idvalue);
con=[SELECT Name, MobilePhone, Id FROM contact WHERE Id=:Idvalue];
return Page.ContactEditPage;
}
}
-
This reply was modified 7 years, 11 months ago by
Jay.