The rendering of a search mask works with ui:repeat
but not with p:dataTable
. Can someone explain this?
Working:
<p:panelGrid>
<ui:repeat value="#{curSearch.getSearchMaskDescription().getRows()}" var="curRow" varStatus="rowStatus">
<p:row >
<ui:repeat value="#{curRow.getElements()}" var="curMaskElement" varStatus="colStatus">
<p:column colspan="#{curMaskElement.columnSpan}">
<mycomp:searchFieldCC isShortSearchMask="false" curMaskElement="#{curMaskElement}" curRowIndex="#{rowIndexVar}"
curColumnIndex="#{columnIndexVar}" />
</p:column>
</ui:repeat>
</p:row>
</ui:repeat>
</p:panelGrid>
Not working:
<p:dataTable id="searchMaskTableId" value="#{curSearch.getSearchMaskDescription().getRows()}" var="curRow" rowIndexVar="rowIndexVar"
styleClass="searchMaskFieldsGrid">
<p:columns value="#{curRow.getElements()}" var="curMaskElement" columnIndexVar="columnIndexVar" colspan="#{curMaskElement.columnSpan}">
<mycomp:searchFieldCC isShortSearchMask="false" curMaskElement="#{curMaskElement}" curRowIndex="#{rowIndexVar}" curColumnIndex="#{columnIndexVar}" />
</p:columns>
</p:dataTable>
The difference is only the iteration I think. ui:repeat
is built in another phase, but I had expected that the ui:repeat
does not work instead.
The rendered html with p:dataTable
:
<div id="searchInstancesFormId:searchMaskTableId" class="ui-datatable ui-widget searchMaskFieldsGrid">
<div class="ui-datatable-tablewrapper">
<table role="grid">
<thead id="searchInstancesFormId:searchMaskTableId_head">
<tr role="row"></tr>
</thead>
<tbody id="searchInstancesFormId:searchMaskTableId_data" class="ui-datatable-data ui-widget-content">
<tr data-ri="0" class="ui-widget-content ui-datatable-even" role="row"></tr>
<tr data-ri="1" class="ui-widget-content ui-datatable-odd" role="row"></tr>
<tr data-ri="2" class="ui-widget-content ui-datatable-even" role="row"></tr>
<tr data-ri="3" class="ui-widget-content ui-datatable-odd" role="row"></tr>
<tr data-ri="4" class="ui-widget-content ui-datatable-even" role="row"></tr>
</tbody>
</table>
</div>
</div>
There are not columns rendered. Why? The form is updated via ajax. The data model is correct.