DataTable: removal of processEvent method
See original GitHub issuefollow-up-issue to https://github.com/primefaces/primefaces/issues/5463
1) Environment
- PrimeFaces version: 8.0-SNAPSHOT
- Does it work on the newest released PrimeFaces version? Version? No
- Does it work on the newest sources in GitHub? (Build by source -> https://github.com/primefaces/primefaces/wiki/Building-From-Source) No
- Application server + version: all
- Affected browsers: all
Only relevant for DataTable with Paging but without LazyDataModel.
2) Expected behavior
filterBy should be the “single source of truth” for filtering.
3) Actual behavior
DataTable materializes filteredValue as java.util.List<?>.
This list is used from DataTable#processEvent
.
@Override
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
super.processEvent(event);
if (!isLazy() && event instanceof PostRestoreStateEvent && (this == event.getComponent())) {
Object filteredValue = getFilteredValue();
if (filteredValue != null) {
updateValue(filteredValue);
}
}
}
Sometimes filterBy and filteredValue get´s out of sync. (eg DataTable is bound to a SessionScoped bean) processEvent only seems to be called at Paging-events of DataTable.
Calling updateValue(filteredValue);
does not seem to be necessary.
4) Steps to reproduce
https://www.primefaces.org/showcase/ui/data/datatable/tableState.xhtml (multiViewState can be set to false, as it´s not relevant for this issue.)
- Select “Renault” as Brand
- Refresh
- Everything looks good
- Go on page 5: no result (NOK)
- Go back on page 1: filter Renault is back (NOK)
5) Sample XHTML
Showcase: ui/data/datatable/tableState.xhtml
6) Sample bean
Showcase: org.primefaces.showcase.view.data.datatable.TableStateView
(must be @SessionScoped
to reproduce this issue)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
FYI: https://github.com/primefaces/primefaces/issues/1390#issuecomment-248271391 I think this piece of code causes more problems than it fixes
I’m closing this for now as I’m working on #1390 and they’re related (and I think the fix is a more than juste removing the method)