2 Replies Latest reply on Mar 19, 2010 9:10 PM by Xavier de la rocha

    Simple Form

    Xavier de la rocha Newbie

      I have this code:




         <a4j:region id="region1">     
              <h:selectOneMenu value="#{myBean.selectedCountry}" id="countries" >
                  <f:selectItems value="#{myBean.listCountries}" />
                  <a4j:support actionListener="#{myBean.countryChanged}" event="onchange" reRender="states" />
                  <h:outputLabel value="Countries:" for="countries"/>       
         <a4j:region id="region2">
              <h:selectManyListbox id="states" value="#{myBean.selectedListStates}">
                  <f:selectItems value="#{myBean.listStates}"/>
                  <h:outputLabel value="States:" for="states"/>


      <a4j:commandButton actionListener="#{myBean.showValues}" reRender="country" value="execute" >


      <a4j:region id="region3">                      
              <h:outputText value="#{myBean.selectedCountry2}" id="country"/>


      I want to read the selectedCountry value (and selectedListStates)


      my bean:


         // private selectedCountry, selectedCountry2

         //get and set methods ...


          public void showValues(ActionEvent event){

              this.selectedCountry2 = this.selectedCountry;       



      If I just select  a item from selectOneMenu I get the correct value; but when I select a item from selectManyListBox I get a blank value.




        <managed-bean-scope>request</managed-bean-scope> <!-- I need to use request scope and not session scope -->