theresa
theresa

Reputation: 11

How to Display Multiple Dynamic Data table using JSF

I have already successfully displayed a dynamic datatable (dynamic columns and rows) in my jsf page.

However, i need to display more than 1 table - vertically. How do I iterate in my list in order to display them?

thanks

Theres

Upvotes: 1

Views: 1922

Answers (2)

Tonino
Tonino

Reputation: 1166

Another example with more details:

<ul>
             <ui:repeat value="#{timeslipBean.usersSlips}" var="tabSlips" >
            <li>
             <p:dataTable id="timeslips" var="time" value="#{tabSlips.table}">
             <h2>
                 #{tabSlips.label} 
            </h2>                    
                  <p:column >
                   <f:facet name="header" >  
                               User  
                   </f:facet>  
                        <h:outputText value="#{time.user}"/>
                  </p:column>
                  <p:columns value="#{tabSlips.columns}" var="column" columnIndexVar="colIndex" styleClass="#{time.times[colIndex].festivo ? 'festivo' : null}">  
                         <f:facet name="header">  
                               #{column.header}  
                        </f:facet>  
                        <h:outputText value="#{time.times[colIndex].hours}" styleClass="#{time.times[colIndex].style}"/>
                   </p:columns> 
              </p:dataTable>    
            </li>
        </ui:repeat>
    </ul>   

Upvotes: 0

Daniel
Daniel

Reputation: 37061

How about

    <ul>
        <ui:repeat value="#{someBean.items}" var="someCurrentItems">
            <li>
                <h:dataTable value="#{someCurrentItems}" var="currentItem"></h:dataTable>
            </li>
        </ui:repeat>
    </ul>   

And if you want to get rid of the bulletins add this to your css file (you can give a more precise selector to the css if you will wrap the ul with some div with id...)

ul { list-style-type: none; }

Upvotes: 1

Related Questions