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: removal of processEvent method

See original GitHub issue

follow-up-issue to https://github.com/primefaces/primefaces/issues/5463

1) Environment

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:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Rapstercommented, Sep 3, 2020

FYI: https://github.com/primefaces/primefaces/issues/1390#issuecomment-248271391 I think this piece of code causes more problems than it fixes

0reactions
Rapstercommented, Nov 25, 2020

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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

off() - DataTables
This off() method is used to remove a listener that has already been attached to a DataTable. Simply pass in the event you...
Read more >
org.primefaces.component.datatable.DataTable.isLazy java ...
DataTable.processEvent(...) @Override public void processEvent(ComponentSystemEvent event) throws AbortProcessingException { super.processEvent(event); if ...
Read more >
DataTable: Filter getFilteredValue out of sync #1390 - GitHub
In this app we make use of the datatable filter ajax event and call a listener to update ... DataTable: removal of processEvent...
Read more >
gui.components Class DataTable - PhysMo
gui.components. Class DataTable. java.lang.Object extended by java.awt.Component extended by java.awt.Container extended by javax.swing.
Read more >
Useful PrimeFaces DataTable Events - Beyond Java
keyword . Immediately before the page is drawn, the preRenderView event is fired and caught by a JSF bean method ( catalogController.doSearch() ) ......
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