2 Replies Latest reply on Apr 30, 2007 4:24 AM by liumin hu

    a4j:repeat does not work in rich:datatable

    liumin hu Master

      1) I tried to replace t:columns with a4j:repeat, but it does not work in rich:datatable. same for ui:repeat.

       <rich:dataTable var="row" value="#{bean.data}">
       <rich:column>
       <f:facet name="header">
       <t:outputText value="Groupe" />
       </f:facet>
       <t:outputText value="#{row.group}" />
       </rich:column>
       <rich:column>
       <f:facet name="header">
       <t:outputText value="Label" />
       </f:facet>
       <t:outputText value="#{row.libelle}" />
       </rich:column>
      
       <a4j:repeat value="#{bean.columnHeaders}" var="day">
       <rich:column>
       <f:facet name="header">
       <t:outputText value="#{day.value}" >
       <f:convertDateTime pattern="dd/MM/yy " />
       </t:outputText>
       </f:facet>
       </rich:column>
       </a4j:repeat>
       </rich:dataTable>
       <a4j:repeat value="#{bean.columnHeaders}" var="day">
       <t:outputText value="#{day.value}" >
       <f:convertDateTime pattern="dd/MM/yy "/>
       </t:outputText>
       </a4j:repeat>
      


      2) how much rich:columngroup can be used in a rich:datatable? Could we mix rich:column with rich:columngroup?

        • 1. Re:  a4j:repeat does not work in rich:datatable
          Sergey Smirnov Master

          a4j:repeat, ui:repeat or any other similar JSF components will not work in such role. See my answer at http://jboss.com/index.html?module=bb&op=viewtopic&t=106113

          rich:columnGroup is useful when you want to apply some attributes (style* or on*) on the set of columns.
          rich:columnGroup is very useful to build complex header or footer (as soon as facets do not accept several rich:column as children).
          See the beginning of an incomplete article about rich:dataTable :
          http://labs.jboss.com/wiki/RichFacesArticleDataTable

          You can mix rich:column and rich:columnGroup, as well as h:column, t:column, t:columns

          • 2. Re:  a4j:repeat does not work in rich:datatable
            liumin hu Master

            hi sergey,

            thanks for your reply.

            1) I have read your post. you suggest use c:foreach to replace t:columns? i dont like c:foreach very much. and In the developper guide of facelets they suggest "The repeat tag should be used in almost all cases instead of the c:forEach to iterate over content with JSF".

            2)I think your model columngroup is a little complex to use. for nested column , the ADFFaces has a better approach. I will be happy if i could have same thing in rich:datatable.

            <af:column>
             <f:facet name="header">
             </f:facet>
             <af:column>
             <f:facet name="header">
             </f:facet>
             .......
             </af:column>
             <af:column>
             <f:facet name="header">
             </f:facet>
             ......
             </af:column>
            </af:column>