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
Nageswara  reddyNageswara reddy 

editing a rocord From page Block Table

Hi All;

 

 I have one custom Object Like  Project_ Details__c  inthat four fields are there like project Name, client Name,startdate, end date, . now  I have  crated on visualforce  page  with foour input text fields and also  pageblock Table with the same columns .  suppose i  create with one record through my vf page  , it will be saved into my object , and then  entered into page Block table,. 

 

 Now   What my intension is editing record thrugh  PageBlock table,  the Page Block Table is Like 

 

 AAAAbbbb6/26/20126/26/2012
Aaaaaaaaaaaabbbb6/26/20126/26/2012
AaBb6/26/20126/26/2012
Nagesh Clientnagesh Client6/26/20126/26/2012

   at the end of the each PageBlock record I I have edit Button


 now  i click  edit   button of page block table  the record  is updated in my custom object and page block Table  any body can help

 

Thanks

Suresh RaghuramSuresh Raghuram

In one of your pageblock table columns create command link for edit and the write the following code at the back end

 

 

in pgbtable column

<apex:commandlink action="{!edit} value="edit" >edit</apex:commandlink>

 

in the class

 

Public pageReference edit(){

 

pagereference pageref = new pagereference('/editpageid/{acc.Id})');  //acc.id is the current record for update

pageref.setredirect(true);

return pageref;

 

}

I bet this helps you.

Mr Reddy if this answers your question mark is as solution.

Milan SanghaniMilan Sanghani

Public pageReference edit(){

 

pagereference pageref = new pagereference('/editpageid/{acc.Id})');  //acc.id is the current record for update

pageref.setredirect(true);

return pageref;

 

}

 

In this Method how to pass selected "acc.Id" or any selected record id to this method form pageBlockTable in visualforce page

Suresh RaghuramSuresh Raghuram

i think u can place a edit command button link at each row  and when you click it edit it inline or move to the detail page where you can edit the record.