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
VRKVRK 

apex:selectlist picklist values not performing values

Hi 
when select picklist value, based on selection , populate table results...but below code not working, can u pls check is there any wrong in below my code

VF page:
<apex:selectList value="{!statusOptions}" multiselect="false" size="1">
     <apex:selectOptions value="{!items}"/>
     <apex:actionSupport event="onselect" action="{!poplateResults}" reRender="messageBlock"/>
     </apex:selectList> 

 <apex:actionStatus id="status" startText="requesting..."/>
<apex:pageBlockSection title="Results" id="results" columns="1">
                    <apex:pageBlockTable value="{!results}" var="c"
                               rendered="{!NOT(ISNULL(results))}">
<apex:column value="{!c.Type}" />
                    <apex:column value="{!c.Subject}" />
                    <apex:column value="{!c.Priority}" />
                    <apex:column value="{!c.Status}" />
                    <apex:column value="{!c.CreatedDate}" />
                     <apex:column value="{!c.Owner.Name}" />    
                    <apex:column value="{!c.SLA_Flag__c}" />
   </apex:pageBlockTable>

Controller class ::
------------------------------
public List<SelectOption> getItems() {

        List<SelectOption> options = new List<SelectOption>();
        
        options.add(new SelectOption('Admin));
        options.add(new SelectOption('Dev'));
        options.add(new SelectOption('Suppp'));
        options.add(new SelectOption('Test));
       
        return options;
    }
 public void poplateResults()
    {
         results = [select CaseNumber,Type, Subject, Priority,Status,CreatedDate,SLA_Flag__c,Owner.Name  from Case where Mail_Box_Name__c=:statusOptions];
    }

please check is there any wrong in my code ...Thanks
Leo10Leo10
Hi,
Check this code.
VF page:
<apex:selectList value="{!statusOptions}"  multiselect="false" size="1">
     <apex:selectOptions value="{!items}"/>
     <apex:actionSupport event="onselect" action="{!poplateResults}" reRender="messageBlock"/>
     </apex:selectList> 

 <apex:actionStatus id="status" startText="requesting..."/>
<apex:pageBlockSection title="Results" id="results" columns="1">
                    <apex:pageBlockTable value="{!results}" var="c"
                               rendered="{!NOT(ISNULL(results))}">
<apex:column value="{!c.Type}" />
                    <apex:column value="{!c.Subject}" />
                    <apex:column value="{!c.Priority}" />
                    <apex:column value="{!c.Status}" />
                    <apex:column value="{!c.CreatedDate}" />
                     <apex:column value="{!c.Owner.Name}" />    
                    <apex:column value="{!c.SLA_Flag__c}" />
   </apex:pageBlockTable>

   Controller class ::
------------------------------
public List<SelectOption> getItems() {

        List<SelectOption> options = new List<SelectOption>();
        
        options.add(new SelectOption('Admin','Admin'));
        options.add(new SelectOption('Dev','Dev'));
        options.add(new SelectOption('Suppp','Suppp'));
        options.add(new SelectOption('Test','Test'));
       
        return options;
    }
 public void poplateResults()
    {
         results = [select CaseNumber,Type, Subject, Priority,Status,CreatedDate,SLA_Flag__c,Owner.Name  from Case where Mail_Box_Name__c=:statusOptions];
    }

Warm Regards,
Nabeel
VRKVRK
Hi Nabeel,
thanks for your response.........i cant see any modifcations in your copy code .....please let me know what are the changes you did in the code ..Thanks
Leo10Leo10
See this
options.add(new SelectOption('Admin','Admin'));
options.add(new SelectOption('Dev','Dev'));
options.add(new SelectOption('Suppp','Suppp'));
options.add(new SelectOption('Test','Test'));
VRKVRK
thanks.. i think this is not the problem, this one already written.
could you please check is there any other mistakes in the code ..
Leo10Leo10
I have tested this. This is working for me.