0 Replies Latest reply on Sep 15, 2011 3:51 PM by aldosilva

    selectOneMenu + a4j:ajax

    aldosilva

      Hi everyone.

       

      I'm using jsf 2.0 and RichFaces 4.0.0.Final. I had a problem with selectOneMenu component, when I selected the first option, the second is reloaded but it doesn't seem to be validating the combo, and the selected value is null.

       

      Here's attached the source code of my page.

       

       

      <div id="selectUser">

                                  <h:panelGrid columns="3">

                                      <h:outputLabel value="Selecione o Usuário" />                                                           

                                      <h:selectOneMenu value="#{selectUserAndPhase.itemUserValue}" valueChangeListener="#{selectUserAndPhase.valueChanged}" id="selectUserMenu" required="true" requiredMessage="*obrigatório">

                                          <f:selectItem itemValue="" itemLabel="Selecione"/>

                                          <f:selectItems value="#{selectUserAndPhase.listUser}" />

                                          <a4j:ajax event="change"  render="selectPhase" />

                                      </h:selectOneMenu>

                                      <h:message style="color:red" for="selectUserMenu" />                               

                                  </h:panelGrid>

                              </div>

                              <a4j:outputPanel id="selectPhase" layout="block" >

                                  <h:panelGrid columns="3">

                                      <h:outputLabel value="Selecione a Fase" rendered="#{not empty selectUserAndPhase.itemUserValue}" />                                                           

                                      <h:selectOneMenu value="#{selectUserAndPhase.itemPhaseValue}" rendered="#{not empty selectUserAndPhase.itemUserValue}" id="selectPhaseMenu" required="true" requiredMessage="*obrigatório">

                                          <f:selectItem itemValue="" itemLabel="Selecione"/>

                                          <f:selectItems value="#{selectUserAndPhase.listPhase}" />

                                      </h:selectOneMenu>                               

                                      <h:message style="color:red" for="selectPhaseMenu" />                       

                                  </h:panelGrid>                   

                              </a4j:outputPanel>

       

      Thanks in advance for helping me.