Dynamically create pairs of rich columns: columns

Is it possible to dynamically generate pairs of columns using the RichTaces component rich:columns? (Version 3.3.0)

Ideally, I would like to generate something similar to the following:

+------+--------------+--------------+---------------
| Name |    1/2/09    |    2/2/09    | 3/2/09 (etc.)
+------+------+-------+------+-------+-----------
| .... | Time | Value | Time | Value |
+------+------+-------+------+-------+-------
| .... | Time | Value | Time | Value |

... that is, one header cell for each pair of columns with two columns at the bottom. However, the combined title is not so important.

I consulted with the documents, and although they suggest that they colspancan (in some way) be used, they do not offer any examples.

Any help appreciated!

+3
source share
1 answer

. , oneElementCollection , DaysData, List .

<rich:dataTable value="#{oneElementCollection}" var="daysData">

     <a4j:repeat value="#{daysData.days}" var="day">
         <rich:subtable value="#{day.infos} var="info">
             <f:facet name="header">
                <h:outputText="#{day.display}" />
             </f:facet>
             <rich:column>
                 <f:facet name="header">
                    <h:outputText="time" />
                  </f:facet>
             <h:outputText value="#{info.time}" />
           </rich:column>
             <rich:column>
                 <f:facet name="header">
                    <h:outputText="value" />
                  </f:facet>
             <h:outputText value="#{info.value}" />
           </rich:column>
         </rich:subtable>
     </a4j:repeat>

</rich:dataTable>
+2

Source: https://habr.com/ru/post/1723628/


All Articles