简体   繁体   中英

Primefaces datatable filterBy String

I have already read suggested posts, but none of them worked for my issue. The problem is that when selecting a criteria to filter by, nothing happens.

在此处输入图片说明

<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>

In the backing bean there is nothing special, just the method that is loading tasks and lists for tasks, filteredTasks and priorities for selectmenu.

Please advise.

Update (links I tried)

primefaces Datatable filter is not working - i don't know why this is not working, nothing happens. I also tried with contains, to search for a signle priority at once.

FilterBy using column doesn't work in primefaces 5.3 - nothing happens

Primefaces dataTable filter search By not found - nothing happens, too

I had similar problems, searched long, from browser console log saw this error- "uncaught type error: cannot read property 'keycode' of undefined"

This was due to jQuery conflict, I have disabled all jQuery imports and working fine. Got the solution here-

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM