function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
puli rajupuli raju 

pass a value list values available in page to controller

DeepthiDeepthi (Salesforce Developers) 
Hi,

You can pass the values from Page to controller using the param function. Please take a look on the code below.
 
<apex:page controller="ControllerClass">
<apex:form >
<apex:pageBlock >
    <apex:pageBlockTable var="c" value="{!Cnd}">
        <apex:column headerValue="Name">
            <apex:outputText >
            <apex:commandLink value="{!c.First_Name__c}" action="{!directVal}">
            <apex:param value="{!c.id}" name="getId"/>
            </apex:commandLink>
            </apex:outputText>
        </apex:column>
    </apex:pageBlockTable>

<apex:pageBlockTable var="c1" value="{!Cnd1}">
    <apex:column headerValue="First Name">
        <apex:inputField value="{!c1.First_Name__c}"/>
    </apex:column>
    <apex:column headerValue="Last Name">
        <apex:inputField value="{!c1.Last_Name__c}"/>
    </apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
 
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;
     }
  
  
       
}

Hope this helps you!
Best Regards,
Deepthi