7 Replies Latest reply on May 29, 2013 11:20 PM by Thy Ngoc Hoang

    About collapsibleSubTable

    Thy Ngoc Hoang Newbie

      Hi,

       

      I'm a new member of richfaces.

      I have a problem when display data table with using collapsibleSubTable.

      This table is the same window explorer. When expand the parent folder, all sub folders and file will be appared.

       

      The source code is bellow :

       

      <rich:dataTable value="#{gcnf010Bean.hierachicalItems}" var="item" id="#{idTable}" rows="20"
                      rowClasses="oddRow, evenRow" styleClass="resultTable">
      
          <f:facet name="header">
              <rich:columnGroup>
                  <rich:column>
                      <h:outputText value="Category"/>
                  </rich:column>
                  <rich:column>
                      <h:outputText value="level1"/>
                  </rich:column>
                  <rich:column>
                      <h:outputText value="level2"/>
                  </rich:column>
                  <rich:column>
                      <h:outputText value="Quantity"/>
                  </rich:column>
              </rich:columnGroup>
          </f:facet>
      
          <rich:column>
              <rich:collapsibleSubTableToggler id="subcategoryGroup" for="categoryGroup"/>
              <h:outputText value="#{item.category}"/>
          </rich:column>
          <rich:column>
              <h:outputText value=" "/>
          </rich:column>
          <rich:column>
              <h:outputText value=" "/>
          </rich:column>
          <rich:column>
              <h:outputText value="#{item.quantity}"/>
          </rich:column>
      
          <rich:collapsibleSubTable value="#{item.children}" var="cat" expanded="false" expandMode="client"
                                    id="categoryGroup">
              <rich:column></rich:column>
              <rich:column>
                  <rich:collapsibleSubTableToggler id="sublevel1Group" for="level1Group" rendered="true"/>
                  <h:outputText value="#{cat.level1}3"/>
              </rich:column>
              <rich:column><h:outputText value=" "/></rich:column>
              <rich:column>
                  <h:outputText value="#{cat.quantity}"/>
              </rich:column>
        
              <rich:collapsibleSubTable value="#{cat.children}" var="lev" expanded="false" expandMode="client"
                                        id="level1Group">
                  <rich:column></rich:column>
                  <rich:column></rich:column>
                  <rich:column><h:outputText value="#{lev.level2}"/></rich:column>
                  <rich:column>
                      <h:outputText value="#{lev.quantity}"/>
                  </rich:column>
              </rich:collapsibleSubTable>
      
          </rich:collapsibleSubTable>
      
      </rich:dataTable>
      

      Always click toggle of of sub table "level1Group", the collapse of "categoryGroup" is enclose.

      Please help me.

       

      Thanks