[SalesForce] How to rerender output panel on change apex selectList

I want to display different picklist values on selecting another picklist value. So i have put one on change event in the first selectlist and using action function i'm passing the selected attribute value to the controller. But my controller method which is referred in action function is not getting called atleast. Here is my code

<apex:page standardController="Account" extensions="AccountRecTypeChange_CLS">
 <apex:form >
<apex:actionFunction name="changeTier" action="{!mymet}" reRender="tierId"/>
<apex:outputPanel id="recTypeId">
  <apex:selectList value="{!strRecTypeName}" size="1" multiselect="false">
    <apex:selectOptions value="{!recTypeList}"/>
  </apex:selectList>
  </apex:outputPanel>
  <apex:outputPanel id="tierId">
  <apex:selectList value="{!strTier1}" size="1" multiselect="false" onchange="changeTier();">
    <apex:selectOptions value="{!Tier1_ClassificationList}"/>
  </apex:selectList>
  <apex:commandButton value="Save" action="{!CustomSave}"/>
  &nbsp;&nbsp;&nbsp;<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:outputPanel>
</apex:form>
</apex:page>

Controller :

public PageReference mymet() {

return null;

}

Best Answer

You can use ActionSupport tag to rerender the section. You do't need actionfunction and controller method.

<apex:selectList value="{!strTier1}" size="1" multiselect="false" onchange="changeTier();">
    <apex:selectOptions value="{!Tier1_ClassificationList}"/>
      <apex:actionSupport event="onchange" rerender="tierId"/> //onselect
  </apex:selectList>
Related Topic