2 Replies Latest reply on Dec 22, 2008 1:16 AM by user080701

    problem on three hierarchy selections using ajax

      Hi

      I want to provide three hierarchy selections (country, province, city) with ajax feature. When user selects the country, I call the valuechange event to get the list of province under the country for user select. This works for the country selection, but when user select the province, no valuechange event be called !!!

      Below is my code for reference:

      <a4j:region>
      <h:selectOneListbox id="countrySelect" size="1"
      value="#{user.user.ctry}" valueChangeListener="#{user.changedCountry}" required="true" label="#{msg.country}">
      <a4j:support event="onchange" reRender="location"/>
      <f:selectItem
      itemValue="" itemLabel="#{msg.reg_select_country}"/>
      <f:selectItems value="#{user.countryItems}" />
      </h:selectOneListbox>
      </a4j:region>

      ....................................................................

      <h:panelGroup id="location">
      <a4j:region>
      <h:selectOneListbox id="provinceSelect" size="1"
      value="#{user.user.provinceKey}" valueChangeListener="#{user.changedProvince}" label="#{msg.province}">
      <f:selectItem
      itemValue="" itemLabel="#{msg.reg_select_province}"/>
      <f:selectItems value="#{user.provinceItems}" />
      <a4j:support event="onchange" reRender="citySelect"/>
      </h:selectOneListbox>
      </a4j:region>
      <h:outputLabel for="citySelect">
      <h:outputText value="#{msg.city} :"/>
      </h:outputLabel> :
      <h:selectOneListbox id="citySelect" size="1"
      value="#{user.user.cityKey}" label="#{msg.city}">
      <f:selectItems value="#{user.cityItems}" />
      </h:selectOneListbox>
      </h:panelGroup>


      Has any problem on my code?