question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataTable/TreeTable: GlobalFilter not working with filterable="false"

See original GitHub issue

Describe the defect Global filter works only on p:column that has atribute filtarable="true", but it should work on every column that has filterBy="" atribute. I have a datatable where I need only the global filter, not the column filters. To disable column filter I use <p:column filterable="false"/>, but this breaks the GlobalFilter in PF10, in PF8 it works as expected. I haven’t tested yet, but this may affect treetable too.

Reproducer Clone repository https://github.com/stefan-dan/primefaces-test

Environment:

  • PF Version: 10.0
  • JSF + version: Mojarra 2.2.8 and MyFaces 2.3.6
  • Affected browsers: ALL

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘http://localhost:8080/primefaces-test/
  2. Click on 'Global filter Enter keyword’
  3. Write ‘Stefan’
  4. Works as expected
  5. Write ‘Moldova’
  6. See error

Expected behavior Expected behaviour: Global filter should work on all p:columns that has atribute filterBy=“”, despite of filterable=“” value.

Example XHTML

<p:dataTable var="customer" value="#{dtFilterView.customers1}" widgetVar="customersTable"
                             emptyMessage="No customers found with given criteria"
                             filteredValue="#{dtFilterView.filteredCustomers1}">

                    <f:facet name="header">
                        <div class="p-d-flex p-ai-center p-jc-between">
                            <span>List of Customers</span>
                            <p:inputText id="globalFilter" onkeyup="PF('customersTable').filter()" style="width:10rem" placeholder="Enter keyword" />
                        </div>
                    </f:facet>

                    <p:column headerText="Name" sortBy="#{customer.name}" filterBy="#{customer.name}" filterable="false">
                        <h:outputText value="#{customer.name}" />
                    </p:column>
</p:dataTable>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, Apr 2, 2021

because of this example: https://www.primefaces.org/showcase/ui/data/datatable/field.xhtml Fields sets a whole bunch of defaults and you can turn things off with filterable="false" etc.

0reactions
mellowarecommented, Jun 15, 2021

How about instead of hideFilter we use filterDisplayed with a default to true and you can hide it with filterDisplayed="false" that way it starts with the word “filter” so IDE’s and our doc pages have it lined up with other filter props?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Cloud Gateway Global Filter Not Working
I'm not getting an output from my global filter (or any of my filters). I can verify that the bean for each filter...
Read more >
Why Global Search Is Not Working For This Primeng Table
My global filter works perfectly when it is placed in the p:dataTable but I want to put it outside of data table and...
Read more >
Global Filter - Innovative Filtration Solutions
Global Filter, offers you filtration products and solutions to help make the world safer, healthier, & more productive.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found