+ Start a Discussion
aswanijagadesh1.397398535585991E12aswanijagadesh1.397398535585991E12 

how to get row field values into controller when row is clicked?

hai friends
when i click on a row in visual force page i want to get these field values into controller please any one guide me urgent
<apex:page standardController="Lead" recordSetVar="leads" tabstyle="lead" sidebar="false" extensions="leadclickgenaccount">
   <script>
   fun()
   {
   }
  
   </script>
  
   <apex:pageBlock >
    <apex:pageBlockTable value="{!leads}" var="ld"  onRowClick="fun();">
      <apex:column value="{!ld.name}"/>
      <apex:column value="{!ld.phone}"/>
      <apex:column value="{!ld.email}"/>
    </apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>
Vinit_KumarVinit_Kumar
You should use <apex:param> tag inside <apex:actionSupport> and pass the id as param to controller.!!
aswanijagadesh1.397398535585991E12aswanijagadesh1.397398535585991E12
i want field values not id,when ever i click on particular row that row field values i have to get into controller.by taking those values i have to insert account
Vinit_KumarVinit_Kumar
Ok so u need to create a setter method in controller something and set the values to a variable in controller ,something like below :-


VF page 

<apex:column value="{!lstr}"/> // This sets the values to String str in controller

Apex class

public String str{get;set;}


aswanijagadesh1.397398535585991E12aswanijagadesh1.397398535585991E12
no not this ,bye using above code it will display lead records in visual force page,in vf page click on row when that row values i have to take into controller
Vinit_KumarVinit_Kumar
Ohk  !! Use a wrapper class and store the value in a variable :-

go through the below links to learn more :-

https://developer.salesforce.com/page/Wrapper_Class

http://www.minddigital.com/what-is-wrapper-class-and-how-to-use-it-in-salesforce/

http://www.sfdcpoint.com/salesforce/wrapper-class-in-apex/

Hope this helps !!

If this helps,please mark this as best answer to help others :)