过滤primefaces 'tasksDataTable' 后,'记录数' 不会更新。例如,在过滤记录数为 45 之前,通过过滤表我得到 3 条记录作为结果。但是“记录数”已经是 45(我希望过滤后的“记录数”显示 3)。我该如何处理?
<p:dataTable var="recordEntity"
id="rulesDataTable"
widgetVar="rulesDataTable"
value="#{bossCartable.tasksDataTable}"
paginator="true"
paginatorAlwaysVisible="false"
rows="#{paginationModel.rows}"
paginatorTemplate="#{paginationModel.paginationTemplate}"
rowsPerPageTemplate="#{paginationModel.rowsPerPageTemplate}"
currentPageReportTemplate="#{paginationModel.currentPageReportTemplate}"
selectionMode="single"
selection="#{bossCartable.selectedRuleRow}"
rowIndexVar="rowIndex"
sortBy="#{recordEntity.id}"
emptyMessage="No record found!"
rowKey="#{recordEntity.id}"
resizableColumns="true"
>
<f:facet name="header">
<div class="row align-content-center">
Tasks
<h:outputLabel value="number of records: #{bossCartable.tasksDataTable.size()}"/>
</div>
</f:facet>
<p:column headerText="id" width="5%" filterMatchMode="contains"
filterBy="#{recordEntity.id}" sortBy="#{recordEntity.id}" sortable="true">
<h:outputText value="#{recordEntity.id}"/>
</p:column>
<p:column headerText="description" filterMatchMode="contains"
filterBy="#{recordEntity.description}">
<h:outputText value="#{recordEntity.description}"/>
</p:column>
<p:column headerText="startDate" width="8%" filterMatchMode="contains"
filterBy="#{recordEntity.startDate}">
<h:outputText value="#{recordEntity.startDate}"/>
</p:column>
<p:column headerText="endDate" width="8%" filterMatchMode="contains"
filterBy="#{recordEntity.endDate}">
<h:outputText value="#{recordEntity.endDate}"/>
</p:column>
</p:dataTable>