我有一个Primefaces(5.0)数据表。我使用两个列过滤器:selectOneMenu(Filter1)和selectCheckboxMenu(Filter2)。
两个过滤器的数据都正常填充。 selectOneMenu(Filter1)可以过滤DataTable,但selectCheckboxMenu(Filter2)在选择值后没有找到任何数据。
JSF
<p:dataTable value="#{employeeBean.employees}" var="employee" id="employeeDTable"
emptyMessage="No data" filteredValue="#{employeeBean.filteredEmployees}"
widgetVar="empWidgetVar" rowKey="#{employee.id}">
<!-- THIS WORKS -->
<p:column headerText="Filter1" filterBy="truck.id" filterMatchMode="exact">
<f:facet name="filter">
<p:selectOneMenu onchange="PF('empWidgetVar').filter()">
<f:selectItems value="#{dropdowns.trucksWithAllOption}"/>
</p:selectOneMenu>
</f:facet>
<h:outputText value="#{employee.truck.license}"/>
</p:column>
<!-- THIS DOESN'T WORK (Doesn't find any data) -->
<p:column headerText="Filter2" filterBy="truck.id" filterMatchMode="in">
<f:facet name="filter">
<p:selectCheckboxMenu onchange="PF('empWidgetVar').filter()" label="Vrachtwagen">
<f:selectItems value="#{dropdowns.trucksWithAllOption}"/>
</p:selectCheckboxMenu>
</f:facet>
<h:outputText value="#{employee.truck.license}"/>
</p:column>
</p:dataTable>
dropdowns.trucksWithAllOption
呈现过滤器1
呈现过滤器2
为什么selectCheckboxMenu(Filter2)找不到任何数据而selectOneMenu(Filter1)找不到相同的数据?