+ Start a Discussion
sales@myvarmasales@myvarma 

vf page with search option

when we search with a name it should result opportunity with that name and we should get option to edit or delete in same page
i tried some thing
help me yar

class:

public class oppsearch {
    public List<opportunity> emps{set;get;}
    public string Account name{get;set;}
    public decimal Amount{get;set;}
    public string lead source{get;set;}
    public integer phone{get;set;}
    public string type{get;set;}
    public string opportunity owner{get;set;}
           public String searchData{set;get;}
       
    
    public oppsearch ()
         {
             emps = new List<opportunity>();
          }
          
    public void search()
             {
              opps = [select id, Account name, Amount, lead source, phone, opportunity owner, type from opportunity  where Account name=:searchData];
            }
    
    public void editopps()
             {
             String oppsid= ApexPages.currentPage().getParameters().get('oppsid'); 
 
                 }

    public void Deleteopps()
               {
            String oppsid= ApexPages.currentPage().getParameters().get('oppsid'); 
     
               opportunity opps = [Select id from opportunity where id =:oppsid limit 1];
             if(opps !=null && opps.id !=null)
            {
              delete opps;
             }
             

}
}



vf page::


<apex:page controller="oppsearch" showHeader="false" sidebar="false">
    
    <apex:form id="form">
        <apex:pageBlock mode="inlineEdit">
            <apex:pageBlockButtons location="top">
                
               Enter opportunity name:-<apex:inputText value="{!searchData}" />
            <apex:commandButton value="Searchdata" action="{!search}"/> <br/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
        <apex:pageBlock >
        <apex:pageBlockTable value="{!opps}" var="row">
<apex:column >
<apex:outputLink title="" value="/{!row.id}/e?retURL=/apex/{!$CurrentPage.Name}" style="font-weight:bold">Edit</apex:outputLink>&nbsp;|&nbsp;
<a href="javascript&colon;if (window.confirm('Are you sure?')) Deleteopportunity('{!row.Id}');" style="font-weight:bold">Del</a>
</apex:column>
               
         
            <apex:column value="{!row.Account Name}"/>
            <apex:column value="{!row.Amount}"/>
            <apex:column value="{!row.Lead Source}"/>
            <apex:column value="{!row.phone}"/>
            <apex:column value="{!row.Type}"/> +
              <apex:column value="{!row.Opportunity Owner}"/>
                   
            </apex:pageBlockTable>
        </apex:pageBlock>
            
            <apex:actionFunction action="{!Deleteopps}" name="Deleteopps" reRender="form" >
<apex:param name="opportunityid" value="" assignTo="{!SelectedopportunityId}"/>
</apex:actionFunction>
        
     </apex:form>
</apex:page>
 
sales@myvarmasales@myvarma
errors::   unexpected token name   and    Unknown property 'oppsearch.searchData'
sales@myvarmasales@myvarma
help me