File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Primefaces datatable filter event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Primefaces datatable filter event" Watch "Primefaces datatable filter event" New topic
Author

Primefaces datatable filter event

Daniel Adornes
Greenhorn

Joined: Jul 18, 2006
Posts: 7
Hi all,

I was using Primefaces 2 and decided to upgrade to version 3.2. It was very nice, except for one big thing! The filterEvent attribute seems to no longer exist.

Before upgrading, I used to code this way:



filterEvent no longer exist and, by what I tested, the component is always considering onKeyUp. But when my application opens a list with thousands of registers it becomes frustrating that each time a caracter is typed on the filter field all the result (and the datatable) is once again rerendered. It would be perfect if the typed information was applied to the search only after the field has lost its focus or with some special key like Enter or Tab.

I've seen a great suggestion but that looked too complex for me: http://ovaraksin.blogspot.com.br/2011/04/how-to-filter-pdatatable-on-enter-event.html

Something simpler (like was possible in the Primefaces 2) would be much better.

And I need to use the filter that are avaliable in the datatable component because my customer is very concerned with the space that the elements use on the screen, that is, creating a separate panel with filtering field and a "Search" button is not an option.

Thanks in advance!

Daniel Adornes


Daniel Adornes
Sean Coffey
Greenhorn

Joined: May 31, 2012
Posts: 1
On the dataTable put the following:

filterEvent="enter"

(tested on primeFaces 3.2)
Daniel Adornes
Greenhorn

Joined: Jul 18, 2006
Posts: 7
Hi Sean!

Perfect solution and so simple!! Thank you very much!

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Primefaces datatable filter event