+ Start a Discussion
Vigneshwaran LoganathanVigneshwaran Loganathan 

Need help for following case,

I have record type which is having thousands of records, and i created picklist field to show Records per page ( Values having 10, 25, 50, 100 ). In this i am selecting the picklist value and hit GO button manually to show correponding Records per page. But what I want is when I choose value, it have to load dynamically ( automatically without hitting GO Button )  for the chosen value.  

Thanks in Advance.


Use <apex:actionsupport tag. Like



public class picklistsearch
  public string searchtext{set;get;}
  list<lead> leadlist = new list<lead>();
public list<SelectOption> getitems()
List<SelectOption> options1 = new List<SelectOption>();
options1.add(new SelectOption('None','None')); 
options1.add(new SelectOption('Web','Web')); 
options1.add(new SelectOption('Phone Inquiry','Phone Inquiry'));
options1.add(new SelectOption('Partner Referral','Partner Referral'));
return options1;
public void search()
 for(Lead l : [select id,firstname,lastname,email,leadsource from lead where leadsource =: searchtext]) {

public list<lead> getleads()
  return leadlist;

<apex:page controller="picklistsearch">
  <apex:form >
   <apex:selectList value="{!searchtext}" size="1">
       <apex:selectOptions value="{!items}"/>
         <apex:actionSupport event="onchange" action="{!search}" />
    <apex:pageBlock >
      <apex:pageBlockTable value="{!leads}" var="l">
        <apex:column value="{!l.firstname}"/>
        <apex:column value="{!l.lastname}"/>
        <apex:column value="{!l.email}"/>
        <apex:column value="{!l.leadsource}"/>