Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

FilteringTable add-on

Teppo Kurki
10 years ago Feb 23, 2012 1:05pm

Hi!

I just released a new add-on, FilteringTable. It was supposed to be named FilterTable but someone had already taken that name even though the add-on is no longer available.

Anyway, FilteringTable is basically a customized Table which just adds optional filtering components between the header and body of the Table. The components and filters are generated automatically based on the property types in the container. You can also provide your own filter implementations for any property by implementing the FIlterGenerator interface.

The filter components can not currently be generated by the developer, instead a set of components is provided: enum and boolean properties will get a ComboBox, Date properties get a custom date interval selector and all other types get a simple TextField. For example of implementing Integers with the TextField, see the code examples in the add-on page in directory.

A simple demo application is available here.

You can also provide some customizations to the automatically generated filtering components, as you can see from the demo application. For example you can set the item captions and icons in the ComboBoxes and various captions in the date interval selector.

I welcome any further development ideas and bug reports, so please post them directly to this thread!

Currently known issues:

  • Focusing when keyboard-navigating between filter fields does not work correctly
  • FilterDecorator must be set to the table before the container is set

-Tepi

Last updated on Feb, 23rd 2012
Stéphane Nicoll
10 years ago Feb 27, 2012 7:33pm
Todor Andreev
10 years ago Feb 28, 2012 4:30pm
Jean-François Lamy
10 years ago Mar 01, 2012 6:11pm
Stéphane Nicoll
10 years ago Mar 01, 2012 7:29pm
Teppo Kurki
10 years ago Mar 02, 2012 7:16am
Teppo Kurki
10 years ago Mar 02, 2012 7:19am

Hi,

Jean-François Lamy: Great widget, *should be standard feature of Table and TreeTable* !

But a few notes:
- the very first feedback when I showed this to a user was "it should be possible to filter as soon as I stop typing"
- so I went ahead and extracted the source from the jar
- and I created two maven projects, one for the jar, and one for the demo.
- and I made the requested improvement

Thanks! This does seem like a good feature. Of course one might want to be careful with the text change timeout expecially if each filtering event goes all the way to the database through an SQLContainer or something similar.

Jean-François Lamy: Please find enclosed a zip file with the two Maven projects.

In my variation, FilterDecorator class now has one more method isTextFilterImmediate(Object propertyId). If this method returns true, then the TextField is created with a TextChangeListener (see FilterTable).

It would be great if you made the source available in a repository, and preferably in Maven format.

I'll try to get it into github as soon as I have the time. I'll be sure to include your change :).

-Tepi

Last updated on Mar, 2nd 2012
Teppo Kurki
10 years ago Mar 02, 2012 7:23am
Todor Andreev
10 years ago Mar 02, 2012 11:13am
Jean-François Lamy
10 years ago Mar 03, 2012 1:58am
Rajesh Mulcha
10 years ago Mar 03, 2012 5:41pm
Jean-François Lamy
10 years ago Mar 03, 2012 7:36pm
Rajesh Mulcha
10 years ago Mar 03, 2012 8:52pm
Jean-François Lamy
10 years ago Mar 04, 2012 2:13am
Jean-François Lamy
10 years ago Mar 04, 2012 2:15am
Alecs Farca
10 years ago Mar 05, 2012 12:08pm
Jean-François Lamy
10 years ago Mar 05, 2012 3:27pm
Alecs Farca
10 years ago Mar 06, 2012 10:08am
Jean-François Lamy
10 years ago Mar 06, 2012 12:50pm
Alecs Farca
10 years ago Mar 06, 2012 2:14pm
Todor Andreev
10 years ago Mar 07, 2012 3:26pm
Teppo Kurki
10 years ago Mar 08, 2012 9:41am
Teppo Kurki
10 years ago Mar 08, 2012 9:43am
Fluffy Sandals
10 years ago Mar 08, 2012 10:10am
Stéphane Nicoll
10 years ago Mar 09, 2012 5:12am
Deleted User
10 years ago Mar 09, 2012 7:28am
Todor Andreev
10 years ago Mar 09, 2012 5:04pm
Jean-François Lamy
10 years ago Mar 10, 2012 12:17am
Stéphane Nicoll
10 years ago Mar 10, 2012 8:19am
Teppo Kurki
10 years ago Mar 12, 2012 12:20pm
Stéphane Nicoll
10 years ago Mar 12, 2012 7:26pm
Teppo Kurki
10 years ago Mar 13, 2012 7:02am
Todor Andreev
10 years ago Mar 15, 2012 12:21pm
Stéphane Nicoll
10 years ago Mar 17, 2012 10:27am
Teppo Kurki
10 years ago Mar 19, 2012 7:04am
Stéphane Nicoll
10 years ago Mar 21, 2012 12:47pm
Mika Koskinen
10 years ago Mar 22, 2012 7:46am
Teppo Kurki
10 years ago Mar 22, 2012 12:24pm

I just released version 0.5.1 of the FilteringTable add-on. The changes are listed below:

• Fixed filter field width issue - should now work with virtually all themes
• Added support for text change events per property ID (thanks to Jean-François Lamy)
• Added method to adjust text change event timeout per property ID
• Removed the need to set the FilterDecorator before the container
• Added a getter for filter bar visibility state
• Added a resetFilters method
• Now preserves filter bar visibility state over container/decorator change and filter reset

These are all issues brought up in this thread, so I'd like to thank you for all the bug reports and enhancement requests. The 0.5.1 version is still based on the Table in Vaadin 6.7.5.

Please try out the new version and keep the bug reports and feature requests coming in!

-Tepi

Last updated on Mar, 22nd 2012
Jean-François Lamy
10 years ago Mar 22, 2012 9:02pm
Teppo Kurki
10 years ago Mar 23, 2012 1:55pm