Hello,
I need to resolve the following issue:
I have 2 selects, the first containing cities, the other postal codes. Both selects are required on form submission.
When I select a city the second select needs to be populated with codes depending on what city was selected.
I've tried the following way:
<h:selectOneMenu id="cities" tabindex="28" value="#{registerAction.selectedCity}" valueChangeListener="#{registerAction.setPostalCode}" immediate="true" required="true"> <s:selectItems value="#{cities}" var="city" label="#{city}" noSelectionLabel="-- please select --" /> <a:support event="onchange" reRender="postalCode" immediate="true" /> </h:selectOneMenu> <a:outputPanel id="postalCode"> <h:selectOneMenu id="postalCodes" value="#{registration.person.postalCode}" tabindex="30" required="true"> <s:selectItems value="#{postalCodes}" var="postalCode" label="#{postalCode.code}" noSelectionLabel="-- please select --" /> <f:converter converterId="postalCodeConverter" /> </h:selectOneMenu> </a:outputPanel>
wrap the select with support inside to a4j region to avoid processing of another form components