Upgrading PF 10.0.5 -> 11.0.3 Lazy loading
I'm upgrading Primefaces from 10.0.5 to 11.0.3. In the migration guide https://primefaces.github.io/primeface ... =datatable it says that LazyDataModel now requires to implement int count(Map<String, FilterMeta> filterBy) and that LazyDataModel doesnt need to call setRowCount anymore in the load method. I have implemented the count method and just let it return 0. And have done nothing to the load method. The documentation gives three examples of this https://primefaces.github.io/primefaces ... zy-loading Two examples of count() returning 0. But running this is not working correctly. If I select a value from a dropdown it displays 60 rows. If I select something else from the dropdown (returns 2 rows) and again select the first value from the dropdown it only displays 2 rows. not the original 60 rows. It looks like its not updating correctly. Do I need to do something with the count() and load() methods?
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
if you dont implement #count, you need to call setRowCount in #load, like stated in the docs
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
Yes I am calling setRowCount in #load method. Thats why I am a little confused. I have not made any changes to the load method. Just implemented #count and let it return 0. When you dont implement count, and just return 0, everything should be like in PF10. But I'm not seeing anything in the migration guide and changelog that would cause this.
I have looked a bit more into this and its nothing to do with lazy loading. Since upgrading to PF 11 when deleting a value from a dropdown the change event is not fired. So the previous dropdown value is still selected. But I have not seen any changes in PF 11 that could cause this.
If you can put together a PrimeFaces Test reproducer we can investigate your issue: https://github.com/primefaces/primefaces-test
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
Thanks for the comments, I'm working on a reproducer. I have found that setting forceSelection = false in autocomplete the change event fires correctly when removing a value from the dropdown. Setting forceSelection = true it does not fire at all when removing a value from the dropdown. The change event should fire when the component loses focus, like when you click somewhere else on the page.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 45 guests