vf page:
<apex:page controller="Searchwords">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="criteria">
<apex:outputLabel value="Enter Name Snippet"/>
<apex:inputText value="{!nameQuery}"/>
<apex:commandButton action="{!executeSearch}" value="Search"/>
</apex:pageBlockSection>
<apex:pageBlockTable value="{!product}" var="acc">
<apex:column headerValue="Name">
<apex:outputLink value="/{!acc.id}/e?retURL={!URLENCODE('/apex/RetUrlSearchPage?query='+nameQuery)}">{!acc.Name}</apex:outputLink>
</apex:column>
<apex:column value="{!acc.ProductCode}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
================================================================================= controller:
public class Searchwords {
public String nameQuery {get;set;}
public List<Product2> product{get;set;}
public PageReference executeSearch() {
String queryStr= nameQuery + '%';
product = [select id,Name, ProductCode from Product2 where name like :queryStr];
return null;
}
public String getproduct() {
return null;
}
public Searchwords (){
String urlQuery = ApexPages.currentPage().getParameters().get('query');
}
}
I am getting records based on alphabets, but i want an auto search if u type "a" all products related to "a" must come in sequential order and i want to select one product among "a" and then i want to get infn related to that product only. how can i achieve this by modifing the prgm. please some one help me out.