5 Replies Latest reply on Apr 16, 2014 12:03 PM by David Wong

    Problem with selection on extendedDataTable built with c:forEach

    Joaquín Carrasco Newbie

      Hi, I have in a page a extendedDataTable built with c:forEach because the data that can contain it depends on some input fields. The problem is the data is shown perfectly but the selection on the table rows is not working. The weird thing is when I refresh the page with F5 in firefox, the selection starts to work, but in the first load it doesn´t work.

       

      The code of the table is the following:

       

      <h:form>

                       <rich:extendedDataTable value="#{exttable.actas}"

                          selection="#{exttable.selection}" height="80px" id="actasList"

                          rows="0" var="act" styleClass="scroll">

                          <a4j:ajax execute="@form" event="selectionchange"

                              listener="#{exttable.selectionListener}" render=":res" />

                          <c:forEach items="#{exttable.columns}" var="colum">

                              <rich:column>

                                  <f:facet name="header">

                                      <h:outputText value="#{colum.cabecera}" />

                                  </f:facet>

                                  <h:outputText value="#{act[colum.valor]}" />

                              </rich:column>

                          </c:forEach>

                      </rich:extendedDataTable>

      </h:form>

       

      where colum has the values of the header and the value fields of the different objects the extendeddatatable can contain:

       

      public class ColumnaDinamica {

         

          private String cabecera;

          private String valor;

         

          public String getCabecera() {

              return cabecera;

          }

          public void setCabecera(String cabecera) {

              this.cabecera = cabecera;

          }

          public String getValor() {

              return valor;

          }

          public void setValor(String valor) {

              this.valor = valor;

          }

       

      Any Idea? Thanks!!!