public class ControllerClass {
public List<Candidate__c> Cnd {get; set;}
public List<Candidate__c> Cnd1 {get; set;}
public ControllerClass(){
Cnd = new List<Candidate__c>();
Cnd = [select First_Name__c from Candidate__c];
}
public PageReference directVal() {
Cnd1 = new List<Candidate__c>();
String str = ApexPages.currentpage().getparameters().get('getId'); //retrieved the record of the selected value and stored as a string
Cnd1=[select First_Name__c,Last_Name__c from Candidate__c where id=:str];
return null;
}
}
Like that you can pass the parameters.
Please check and let me know if that helps you.
Thanks,
Sandeep
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_param.htm
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionFunction.htm
Please check the below code snippet on using apex:param to pass values from Visualforce to Controller.
Hope this helps you!
Best Regards,
Deepthi