DataTable: when it is updated, the filter values are set empty. (LazyDataModel + "special" API-usage)
See original GitHub issueAs in the example below, after selecting a value from the selectcheckbox menu, the filter values are lost when the table is updated. It works fine with version 11.
<h:form>
<p:dataTable var="customer" value="#{dtLazyView.lazyModel}" paginator="true" rows="10"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
rowsPerPageTemplate="5,10,15" selectionMode="single"
selection="#{dtLazyView.selectedCustomer}"
id="customerTable" widgetVar="_customerTable">
<p:column headerText="Name" sortBy="#{customer.name}">
<h:outputText value="#{customer.name}"/>
</p:column>
<!-- This filter hides correctly, but is not working when updated -->
<p:column headerText="country " sortBy="#{customer.country}" filterBy="#{customer.country.name}">
<f:facet name="filter">
<p:selectCheckboxMenu id="multiple" value="#{dtFilterView.selectCountries}" style="min-width: 15rem"
multiple="true" scrollHeight="250" updateLabel="true">
<p:ajax event="change" process="@this" update="@form:customerTable"/>
<f:selectItems value="#{dtLazyView.countries}"/>
</p:selectCheckboxMenu>
</f:facet>
<h:outputText value="#{customer.country.name}"/>
</p:column>
</p:dataTable>
</h:form>
Issue Analytics
- State:
- Created a year ago
- Comments:32 (26 by maintainers)
Top Results From Across the Web
13.0.0 Milestone - GitHub
DataTable: when it is updated, the filter values are set empty. (LazyDataModel + "special" API-usage) 12.0.1 defect Something isn't working.
Read more >How to avoid datatable to clear filter in columns on updating ...
I have a datatable with columns, each columns having filter. I am using Lazy data model in order to populate the table.
Read more >Filterable datatable with lazy loading is empty [SOLVED]
I created a p:dataTable like below. The dataTable is rendered okay, but without data. All columns are visible and there are no JavaScript ......
Read more >Filter Data Table - UiPath Documentation Portal
Set Browser Data. Mouse Scroll ... XL-DBP-027 - Empty Use Excel File Activity ... Filter. Filter Pivot Table. Find First/Last Data Row. Find/Replace...
Read more >Range Filter: Reduce of empty array with no initial value
I have added the range_filter plugin to my DataTable $.fn.dataTable.ext.search.push( function( settings, data, dataIndex ) { var min ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Even better - provide a (probably failing) integration test. Use https://github.com/primefaces/primefaces/commit/e7333816c420b260c504f8bc9238ae7059902521 as kind of template. (This way we ensure not to break existing usecases. PrimeFaces, JSF and DataTable allow for so many usecases. Integration tests help us to avoid breaking other existing usecases while trying to fix or enhance other ones.)
Yes that is correct.
Simplified example
Here simple test files i send @mertsincan at PRO support. In this test intentional i show the
filterYear
property again in theheader
facet and also use a second component outside the table to double check.This shows, that the
filterYear
is correctly pushed to the bean but on update the input component in the filter facet is not updated with that value.test-dataTableFilter-ajax-lost.zip