Datatable: Lazy Loading and sort listener in wrong call order
See original GitHub issueDescribe the defect When I use a sort listener in a datatable with lazy loading, the load method is called before the sort listener method. It works fine with a page listener.
Environment:
- PF Version: 10.0
- JSF + version: MyFaces 2.3.6
- Affected browsers: Chrome
To Reproduce Steps to reproduce the behavior: There is no showcase. See the code below.
Expected behavior In Version 8 the sort listener was called before the load method
Example XHTML
<p:dataTable value="#{controller.lazyDataModel}"
lazy="true"
sortMode="multiple"
...>
<p:ajax event="sort" listener="#{controller.sortListener()}" process="@this" />
<p:ajax event="page" listener="#{controller.pageListener()}" process="@this" />
...
</p:dataTable>
Example Bean
@Named
@ViewScoped
public class Controller implements Serializable {
...
public void sortListener() {
sortEvent = true;
}
public void pageListener() {
pageEvent = true;
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Custom sort methods are not being called in lazy loading ...
1 Answer 1 ... The custom sort (or filter functions/methods) do not work when using lazy loading, nor are they intended to. In...
Read more >DataTable Lazy loading with Sorting and filtering
I've a lazy loading datatable with sorting and filtering. ... which means that the load method is called by incorrect paging information.
Read more >Useful PrimeFaces DataTable Events - Beyond Java
The listener function can either take no parameters, or it can take a SortEvent containing information which column is being sorted, and whether ......
Read more >lazy « PrimeFaces « JSF Q&A - Java2s.com
i was developing lazy loading dataTable with primeface with pagination. SelectionMode is multiple. I was selected 3 check box in first page, now...
Read more >DataTable - ICEfaces - ICEfaces.org Community Wiki
Expected type is a List or DataModel. Lazy loading requires an instance of the LazyDataModel object. Sub-row expansion requires a model of type ......
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 FreeTop 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
Top GitHub Comments
Reproducer: pf-7164.zip
10:0.0:
Here is what happens when I dump the stack when the page first loads…
But when the field is sorted you can see the “lazy” method is called in the SortFeature.