[英]JSF PrimeFaces datatable filtering
I 'record' objects and I put them in a datatable
. I“记录”的对象,我把它们放在一个
datatable
。 A record has a boolean value 'Ignored', my idea is to make a filter so that it either shows all ignored records or everything. 一条记录具有布尔值“ Ignored”,我的想法是制作一个过滤器,使其显示所有被忽略的记录或所有内容。 Here is my code:
这是我的代码:
<p:column headerText="Status" filterMatchMode="equals" filterBy="#{record.ignored}">
<f:facet name="filter">
<p:selectOneButton onchange="PF('logTable').filter()">
<f:converter converterId="javax.faces.Boolean" />
<f:selectItem itemLabel="All" itemValue="" />
<f:selectItem itemLabel="Ignored" itemValue="#{record.ignored}" />
</p:selectOneButton>
</f:facet>
<h:outputText value="#{record.status}" />
</p:column>
For some reason it is not working properly which i could not find, after searching for some examples online. 出于某种原因,在网上搜索了一些示例后,它无法正常运行,而我找不到。
The item value for this item 该商品的商品价值
<f:selectItem itemLabel="Ignored" itemValue="#{record.ignored}" />
should be either true
or false
since that is the condition that will be check during the filtering of the records 应该为
true
或false
因为这是在过滤记录时要检查的条件
<f:selectItem itemLabel="Ignored" itemValue="true" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.