Jsf repeat inside datatable

I use datatable and I get the number of columns dynamically. I tried to repeat like this:

<h:dataTable  value="#{movieUserBean.sits}" var="row" 
        rowClasses="oddRows,evenRows" headerClass="header"
        styleClass="table" cellpadding="5" cellspacing="0">

      <ui:repeat  value="#{row}" var="sit">
          <h:column>
             <h:selectBooleanCheckbox   value= "#{movieUserBean.checked[sit.id]}"/>
          </h:column>
      </ui:repeat>

Which syntax is a two-dimensional array, I thought the datatable should loop around the rows and loop around each value inside each row (this is an object called Sit with get method: getId).

The problem is that I get an empty table. It var "sit"doesn't seem to get the meaning. Could the problem be that the datatable ignores any elements that are not in the column area?

+5
source share
2 answers

<table>
    <ui:repeat  value="#{movieUserBean.sits}" var="row">
    <tr>
        <ui:repeat  value="#{row}" var="sit">
          <td><h:selectBooleanCheckbox value= "#{movieUserBean.checked[sit.id]}"/></td>
    </ui:repeat>
    </tr>
    </ui:repeat>
</table>

, css. , 5 1 3 2, . , , .

ui: repeat ul, li div , . .

0

All Articles