+ Start a Discussion
Abhishek PurohitAbhishek Purohit 

How to provide the inline editing and saving of the record as well as assign checklist for selecting particular records fordeletion purpose??

public class OppControl{
    public string name{get;set;}
    public integer amount{get;set;}
    public string stagename{get;set;}
    public date closedDate{get;set;}
 
    String key;
    List<Opportunity> myop;
    String SearchQuery{get;set;}
    public String getkey(){
    return key;
    }
  public OppControl(){
  myop=[Select Name,Amount,StageName,CloseDate From Opportunity];
  }
    public List<Opportunity> getmyop(){
    return myop;
    }

   public void setkey(String ip){
     key=ip;
   }

   public PageReference search(){
    SearchQuery='Select Name,StageName,Amount,CloseDate From Opportunity where Name like '+'\''+key+'%'+'\''; 
    myop=database.query(SearchQuery);
   return null;
}   
   public PageReference add(){
   return Page.vf4;
   
   
  
  } 
   public PageReference save()
   {
       Opportunity oppObj=new Opportunity();
       oppObj.Name=name;
       oppObj.Amount=amount;
       oppObj.StageName=stagename;
       oppObj.CloseDate=closedDate;

       insert oppObj;
            
       return Page.vf3;
       return null;
   }
   
   public PageReference saveit()
  {
    
  //I want to update the inline function
   return null;
  
  }   
   
   
}

//this is the vf3 page
<apex:page controller="OppControl" sidebar="false" showHeader="false">
 <apex:form >
  <apex:pageBlock mode="inlineEdit" title="Search The Opportunities">
   Name: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<apex:inputText value="{!key}"/>
     <apex:commandButton value="Go" action="{!search}"/>
        <apex:commandButton value="Add Opportunity " action="{!add}"/>
        <apex:commandButton value="Save" action="{!saveit}" />
       <apex:pageBlockTable value="{!myop}" var="my">
       <apex:column ><apex:outputLink value="/{!my.id}">"{!my.Name}"</apex:outputLink></apex:column>
        
         <apex:column value="{!my.StageName}"/>
         <apex:column value="{!my.Amount}"/>
         <apex:column value="{!my.CloseDate}"/>
         
      </apex:pageBlockTable>
  </apex:pageBlock>  
 </apex:form>
</apex:page>


Please help by providing above code with the updation,multiple select and delete operation which will also be effective for the database too!