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
davidjbbdavidjbb 

SelectList + Command Button

        
        <apex:selectList value="{!company}"  size="1" >
            <apex:selectOptions value="{!items}"/> 
       </apex:selectList>  

 

Is there a way to merge the rerender + action from the command button into the Select List. Currently, the Button refreshes the service Calendar based on the selected option, but I want it refreshed based on whatever was selected on the picklist instead of using the button

 

the companyView method has the getItems method from the selected options.

      

      <apex:commandButton rerender="serviceCalendarPanel"action="{!companyView}"value="Refresh Calendar"status="loadingStatus"/>

 

       

Best Answer chosen by Admin (Salesforce Developers) 
davidjbbdavidjbb

Solved it.

 

      			  <apex:selectList value="{!company}"  size="1" >
      			      <apex:selectOptions value="{!items}"/> 
      			      <apex:actionSupport event="onchange"  action="{!companyView}" rerender="serviceCalendarPanel" status="loadingStatus"/>
     			  </apex:selectList>     

 

All Answers

davidjbbdavidjbb

Solved it.

 

      			  <apex:selectList value="{!company}"  size="1" >
      			      <apex:selectOptions value="{!items}"/> 
      			      <apex:actionSupport event="onchange"  action="{!companyView}" rerender="serviceCalendarPanel" status="loadingStatus"/>
     			  </apex:selectList>     

 

This was selected as the best answer
JHayes SDJHayes SD

Grats :)