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
SriRamya BeramSriRamya Beram 

I want to display object records using wrapper with inline edit and addrow (where i can enter new account and save)

public class WrapperClass {
    public List<Account> AccountList{get; set;}
        public List<Account> getAccounts(){
            if(AccountList==null){
                AccountList=new List<Account>();
                for(Account acc:[select name,phone,Type from Account limit 10]){
                    AccountList.add(new Account(acc));
               }
            }        
                return AccountList;
        }
   
}
 
Pankaj MehraPankaj Mehra
Hi SriRamya,

Use page block table and apply inline edit as follow :
 
<apex:pageBlockTable value="{!attended}" var="attendee">
     <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" 
                    hideOnEdit="editButton" event="ondblclick" 
                    changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
     <apex:column headerValue="Client">
         <apex:outputfield value="{!attendee.Client__c}"/>
     </apex:column>
     <apex:column headerValue="Attended">
         <apex:outputfield value="{!attendee.Attended__c}"/>
     </apex:column>
 </apex:pageBlockTable>

and you can refer the below link to show add row feature with wrapper

http://bobbuzzard.blogspot.in/2011/07/managing-list-of-new-records-in.html

Thanks


If you're satisfied with the answers provided, please don't forget to select a Best Answer.