voyent
Simple dynamic table with ice:columns  XML
Forum Index -> General Help
Author Message
futhark77

Joined: 18/Sep/2009 00:00:00
Messages: 57
Offline


I have been trying to build a simple dynamic dataTable based on two lists.

rowModel is a ListDataModel of List<String> objects, where each list contains N Strings.
headerModel is a ListDataModel of N String objects.

I had problems with the way models were iterated until I introduced the varStatus attribute. The following ended working as expected.

Code:
         <ice:dataTable value="#{bean.rowModel}" var="row">
             <ice:columns value="#{bean.headerModel}" var="hdr" varStatus="sta">
                 <f:facet name="header">
                     <ice:outputText value="#{hdr}"/>
                 </f:facet>
                 <ice:outputText value="#{row[sta.index]}"/>
             </ice:columns>
         </ice:dataTable>
 


Hope it helps someone.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team