I'm using primefaces-3.0.M1, Mojarra 2.0.4, Glassfish 3.0.1
I set list of datatable column using <c:forEach> tag. I use this approach instead of <p:columns> because it need to have filter and sort for each column.
All works good except two things. In filter and sort fields in p:column are not using value expression for getting field's value. Instead this fields use function resolveField which just removes symbols "#{}" from value expression and further adds it like fields into a FilterMap. Therefore my LazyDataModel.load method can't work properly. i.e. FilterMap always contains field named "filter" and also sort field always equals "sort".
Why it was done by this way?
How I can decide this problem?
Code: Select all
<p:dataTable id="wpsTable"
lazy="true"
rows="#{wpsBean.pageSize}"
var="wps"
selectionMode="single"
selection="#{wpsBean.selectedWPS}"
value="#{wpsBean.topLevelWPS}">
<f:facet name="header">
#{bundle.TopLevelWorkProcessSegment}
</f:facet>
<c:forEach items="#{userConfig.getTable('wps-base').columns}" var="col">
<p:column filterBy="#{col.filter}"
sortBy="#{col.sort}"
filterMatchMode="#{col.filterMatchMode}"
filterStyle="#{col.filterStyle}"
headerText="#{bundle[col.name]}"
style="width: #{col.width}">
<h:outputText value="#{col.valueExpression}" style="#{col.style}"/>
</p:column>
</c:forEach>
</p:dataTable>