2 Replies Latest reply on Jun 22, 2010 11:58 AM by Rodrigo Uchoa

    h:selectOneRadio set method doesn't execute after a rich:dataTable reRender

    Carlos Diógenes Newbie

      Hi,


      I have the following page:

      <a4j:form>
                     <h:selectOneMenu value="#{candidatoList.crgCodigo}">
                          <f:selectItem itemValue="0" itemLabel="Selecione um cargo" />
                          <f:selectItems value="#{cargoList.cargoList}" />
                          <a4j:support event="onchange" reRender="cndOtpPnlId"/>
                     </h:selectOneMenu>
               </a4j:form>
              
               <a4j:outputPanel id="cndOtpPnlId">
                    <rich:dataTable var="_candidato" value="#{candidatoList.candidatosCargo}"
                         rendered="#{candidatoList.crgCodigo > 0}">
                         <rich:column>
                              <f:facet name="header">
                                   Nome
                              </f:facet>
                              #{_candidato.cndNome}
                         </rich:column>
                         
                         <rich:column>
                              <f:facet name="header">
                                   Situação
                              </f:facet>
                              <a4j:form>
                                   <h:selectOneRadio value="#{cndSituacaoList.cndStcCodigo}">
                                        <f:selectItems value="#{cndSituacaoList.cndSituacaoList}" />
                                        <a4j:support event="onclick" />
                                   </h:selectOneRadio>
                              </a4j:form>
                         </rich:column>
                    </rich:dataTable>
               </a4j:outputPanel>


      When I use the h:selecteOneMenu my rich:dataTable is reRendered and show what I expect, but when I click in the h:selectOneRadio inside it the set method is not called.


      If I put the h:selectOneRadio outside the a4j:outputPanel it's work.


      If I fix the value setted by the h:selectOneMenu, forcing the rich:dataTable to be rendered the first time the page is rendered, without having to select nothing in h:selectOneMenu it's also work, but I have to put a4j:region around the a4j:form inside the rich:dataTable.


      Anyone knows how I can solve this. I have already googled a lot, but didn't find anything useful.

        • 1. Re: h:selectOneRadio set method doesn't execute after a rich:dataTable reRender
          Carlos Diógenes Newbie

          Sorry the page get messed, he is the right one:




          <a4j:form>
               <h:selectOneMenu value="#{candidatoList.crgCodigo}">
                    <f:selectItem itemValue="0" itemLabel="Selecione um cargo" />
                    <f:selectItems value="#{cargoList.cargoList}" />
                    <a4j:support event="onchange" reRender="cndOtpPnlId"/>
               </h:selectOneMenu>
             </a4j:form>
             
             <a4j:outputPanel id="cndOtpPnlId">
              <rich:dataTable var="_candidato" value="#{candidatoList.candidatosCargo}"
                   rendered="#{candidatoList.crgCodigo > 0}">
                   <rich:column>
                        <f:facet name="header">
                             Nome
                        </f:facet>
                        #{_candidato.cndNome}
                   </rich:column>
                   
                   <rich:column>
                        <f:facet name="header">
                             Situação
                        </f:facet>
                        <a4j:form>
                             <h:selectOneRadio value="#{cndSituacaoList.cndStcCodigo}">
                                  <f:selectItems value="#{cndSituacaoList.cndSituacaoList}" />
                                  <a4j:support event="onclick" />
                             </h:selectOneRadio>
                        </a4j:form>
                   </rich:column>
              </rich:dataTable>
             </a4j:outputPanel>