Primefaces datatable filterBy String

时间:2017-05-30 10:57:48

标签: jsf primefaces jsf-2 filter datatable

我已经阅读过建议的帖子,但没有一个能够解决我的问题。问题是,在选择要过滤的标准时,没有任何反应。

enter image description here

<h:form id="form"> 

        <p:dataTable var="task" value="#{searchMB.tasksBean}" 
                    emptyMessage="No tasks found with given criteria"
                     widgetVar="tasksTable"  filteredValue="#{searchMB.filteredTasks}">

            <p:column headerText="Priority" filterBy="#{task.priority}" filterMatchMode="in">
                <f:facet name="filter">
                    <p:selectCheckboxMenu label="Show only.." onchange="PF('tasksTable').filter()" panelStyle="width:125px" scrollHeight="50">
                        <f:selectItems value="#{searchMB.priorities}" />
                    </p:selectCheckboxMenu>
                 </f:facet>
                <h:outputText value="#{task.priority}" />
            </p:column>

在支持bean中没有什么特别之处,只有加载任务的方法和任务列表,filteredTasks和selectmenu的优先级。

请告知。

更新(我试过的链接)

primefaces Datatable filter is not working - 我不知道为什么这不起作用,没有任何反应。我也尝试使用contains,一次性搜索一个signle优先级。

FilterBy using column doesn't work in primefaces 5.3 - 没有任何反应

Primefaces dataTable filter search By not found - 没有任何反应

1 个答案:

答案 0 :(得分:0)

我在浏览器控制台日志中搜索了类似的问题,搜索了很长时间-出现“未捕获类型错误:无法读取未定义的属性'keycode'”

这是由于jQuery冲突所致,我已禁用了所有jQuery导入并正常工作。在这里找到解决方案-

<p:autoComplete> Uncaught TypeError: Cannot read property 'keyCode' of undefined