I am trying to reRender a second dropdown upon selecting an item from first dropdown. The reRender works fine. But the second dropdown also has a <a4j:support, which triggers the moment the second dropdown is loaded. How do I stop second dropdown from reloading when first dropdown refreshes the second one.
Code:
<h:selectOneMenu id="depTargetsDropDown" valueChangeListener="#{workspace.selectionChanged}">
<c:forEach var="targets" items="#{workspace.deploymentTargets}">
<f:selectItem itemValue="#{targets.id}" itemLabel="#{targets.name}"/>
</c:forEach>
<a4j:support event="onchange" reRender="packageDropDown"/>
</h:selectOneMenu>
<h:outputLabel value="Packages:" styleClass="labelLeft"/>
<h:selectOneMenu id="packageDropDown" valueChangeListener="#{workspace.selectionChanged}">
<c:forEach var="package" items="#{workspace.selectedPackages}">
<f:selectItem itemValue="#{package.id}" itemLabel="#{package.name}"/>
</c:forEach>
<a4j:support event="onchange"/>
</h:selectOneMenu>
Thanks.