Primefaces <p:datatable> totalRecords 过滤后的未定义值
Primefaces <p:datatable> totalRecords undefined value after Filter
我尝试使用 Primefaces 4 获得总记录数(过滤和不过滤时计算行号)。
在我尝试过滤数据表之前,我的 totalRecords 编号的分页器输出一直有效:
<p:dataTable id="tbl_queue" var="c" value="#{productionQueue.cartQueue}" widgetVar="queueTable"
filteredValue="#{productionQueue.filteredCartQueue}" paginator="true"
currentPageReportTemplate="Nb rows: {totalRecords}"
paginatorTemplate="{CurrentPageReport}">
<p:column id="Bumper_column" filterBy="name_bumper" headerText="Bumper"
filterOptions="#{productionQueue.nameBumperOptionsString}"
filterMatchMode="exact"
styleClass="#{productionQueue.determineRowColor(c.date,c.hour)}">
<h:outputText value="#{c.name_bumper}" />
</p:column>
...
</p:datatable>
每次更新 totalRecords 输出后显示值:"undefined"
编辑(与 PF 展示示例相同的问题):
但是我不得不改变一些东西来 运行 这个例子...:
还有……:
因为当我尝试对 Showcase 中的示例进行任何更改时出现此错误:
所以最后我认为过滤器 Nb Rows 由于 Bean 的类型 (SessionScoped) 而无法正常工作,我被它阻止了,因为我需要此页面中的 SessionScoped 来管理我的数据表...
您的问题很可能是由过滤逻辑中的某些错误引起的。
我做了一个小项目,结合了 PrimeFaces showcase 中的分页和过滤器示例。我使用了 PrimeFaces 4.0
和 Mojarra JSF 2.2.8
.
这是 table 未应用过滤器的情况:
使用过滤器后:
从 PrimeFaces showcase 复制示例时(它使用 PrimeFaces 5.1
),因为 filterMatchMode="equals" 在 PrimeFaces 4.0 中不可用,我在 Tomcat 控制台中收到错误消息:
javax.faces.FacesException: Illegal filter match mode:equals
at org.primefaces.component.datatable.feature.FilterFeature.getFilterConstraint(FilterFeature.java:285)
at org.primefaces.component.datatable.feature.FilterFeature.filter(FilterFeature.java:130)
在当前页面信息中我有你的 undefined
值:
我尝试使用 Primefaces 4 获得总记录数(过滤和不过滤时计算行号)。
在我尝试过滤数据表之前,我的 totalRecords 编号的分页器输出一直有效:
<p:dataTable id="tbl_queue" var="c" value="#{productionQueue.cartQueue}" widgetVar="queueTable"
filteredValue="#{productionQueue.filteredCartQueue}" paginator="true"
currentPageReportTemplate="Nb rows: {totalRecords}"
paginatorTemplate="{CurrentPageReport}">
<p:column id="Bumper_column" filterBy="name_bumper" headerText="Bumper"
filterOptions="#{productionQueue.nameBumperOptionsString}"
filterMatchMode="exact"
styleClass="#{productionQueue.determineRowColor(c.date,c.hour)}">
<h:outputText value="#{c.name_bumper}" />
</p:column>
...
</p:datatable>
每次更新 totalRecords 输出后显示值:"undefined"
编辑(与 PF 展示示例相同的问题):
但是我不得不改变一些东西来 运行 这个例子...:
还有……:
因为当我尝试对 Showcase 中的示例进行任何更改时出现此错误:
所以最后我认为过滤器 Nb Rows 由于 Bean 的类型 (SessionScoped) 而无法正常工作,我被它阻止了,因为我需要此页面中的 SessionScoped 来管理我的数据表...
您的问题很可能是由过滤逻辑中的某些错误引起的。
我做了一个小项目,结合了 PrimeFaces showcase 中的分页和过滤器示例。我使用了 PrimeFaces 4.0
和 Mojarra JSF 2.2.8
.
这是 table 未应用过滤器的情况:
从 PrimeFaces showcase 复制示例时(它使用 PrimeFaces 5.1
),因为 filterMatchMode="equals" 在 PrimeFaces 4.0 中不可用,我在 Tomcat 控制台中收到错误消息:
javax.faces.FacesException: Illegal filter match mode:equals
at org.primefaces.component.datatable.feature.FilterFeature.getFilterConstraint(FilterFeature.java:285)
at org.primefaces.component.datatable.feature.FilterFeature.filter(FilterFeature.java:130)
在当前页面信息中我有你的 undefined
值: