+ Start a Discussion
SFDC_DevloperSFDC_Devloper 

Edit Button in VF Page

Hi All,

I have one checkbox (left side) when ever i checked  the checkbox and click on Edit button here I want edit the the that particula  record in VF page(here User__c is a custom object).Please share any idea...

Please find my attaches image..

User-added image


Thanks
vmanumachu1.393650924860069E12vmanumachu1.393650924860069E12
You mean do you want to open the edit page of the record when edit button is clicked?
SFDC_DevloperSFDC_Devloper
Yes  ...
Saravanan @CreationSaravanan @Creation
Hi

You can do this by using apex:parm tag, apex:actionsupport tag. When you click the checkbox you can pass the record id to
controller by using apex:param tag and you can do rest of the action.

Thanks,
Vinit_KumarVinit_Kumar
This is what that comes to my mind.

On clicking of checkbox you can have an actionsupport tag which would call a controller method and store the Id of the record.Then,on click of Edit button you can call the id and redirect to the Edit page for that record.

hope this helps!!
vmanumachu1.393650924860069E12vmanumachu1.393650924860069E12
A simpler solution would be instead of checkbox you can try the below with OutputLink and $Action:

<apex:page standardController="Account" recordSetVar="acc">
<apex:form >
  <apex:pageBlock title="Accounts">
  <apex:pageBlockSection title="Account List">
  <apex:pageBlockTable value="{!acc}" var="act">
  <apex:column >
    <apex:outputLink value="{!URLFOR($Action.Account.Edit,act.id)}">Edit</apex:outputLink>
  </apex:column>
    <apex:column value="{!act.Name}"/>
  </apex:pageBlockTable>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
</apex:page>
SFDC_DevloperSFDC_Devloper
Hi  @Saravan and @Vinit,


  Can any one please paste some sample code using controller and vf page..

Thanks,
Saravanan @CreationSaravanan @Creation
Hi,

Below blogs are example form apex param tag

https://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_param.htm

http://saravansfdeveloper.blogspot.in/
check only apex param  and how its used in above code

Thanks,