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.

Container.Filterable support for regex matching

David Wall
1 decade ago Apr 29, 2010 12:33am

It seems that the BeanItemContainer or IndexedContainer supports Container.Filterable that takes a 'filterString' that appears to be either 'contains' or 'starts with' along with the option of 'ignore case'. Even an exact match seems to not be supported.

What does it mean to make a simpler regex type filter? That is, with a regex, you can generally take that 'filterString' and make it an exact match, starts with, ends with and ignore case.

How can you get those containers to apply different filter logic (like regex) instead? I seems like an exact match (with or without case matching) should be a pretty common filter need.

Thanks for any tips...

David Wall
1 decade ago Apr 29, 2010 12:39am
Shwetha S.N
1 decade ago Dec 15, 2010 4:30am
Jens Jansson
1 decade ago Dec 15, 2010 6:47am
Jens Jansson
1 decade ago Dec 15, 2010 6:56am

David,

This might come a "tad" late for your needs, as you write the message in April, but I'm glad to say that more flexible filters are looked into right now. Just to give a nudge on the matter, I wrote a patch yesterday that allows filtering with own code. You basically write an own implementation to one method of a filter, which returns true or false depending on if it passes the filter. You can easily write filters like regexp and date matching. The patch can be found here: http://dev.vaadin.com/ticket/6157

The patch is written and implemented into IndexedContainer right now, but I have locally done it for BeanItemContainer as well, and it is just as easy. I don't think the patch will directly get into core Vaadin but I hope it will speed things up. In the meanwhile you could apply the patch locally as it should work perfectly. Sadly, it requires that you subclass the BeanItemContainer, that you hoped to avoid, or build your own custom Vaadin package.

Last updated on Dec, 15th 2010
David Wall
1 decade ago Dec 15, 2010 7:01pm