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.

Filter Constructor/Member Visibilty

Rob Schoening
1 decade ago Jan 25, 2010 11:05pm

In the process of creating a slightly more generic version of BeanItemContainer, I noticed that there are a couple of references to the member Filter.propertyId.

Unfortunately Filter.propertyId and constructor has package visibility, so this cannot be obtained. A public getter might be good so that container implementations can copy the behavior of:

private Item addItemAtInternalIndex(int index, Object newItemId) and
public void addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix);

Incidentally, the container that I have implemented is quite useful. There is:

* an abstract container with extensible adapters (the reflection mechanism of BeanItemContainer might be one implementation)
* an abstract EL implementation that allows EL expressions to be specified in order to extract properties from objects
* a concrete EL implementation using Spring's EL
* a concrete implementation using XPath

This flexibility takes care of 99% of all possible requirements that I have for Containers. Implementing Vaadin containers very error-prone with lots of edge cases (item not found, property not found, etc.), something that I'm guessing would end in tears for 80% of potential users.

I would humbly suggest that something *like* this be considered for inclusion in the core product.

I'll post a link to code shortly.

Nicolas Frankel
1 decade ago Apr 20, 2010 7:48pm

I completely agree with Rob. I'm a Vaadin enthusiast but I must say the Filter/BeanItemContainer was not built for extension.

For example, I must use a Filter that ignores accents (I'm European). I must hack like crazy or copy-paste just to implement a feature that is very useful on our continent (not to mention others).

Please add the feature!

Michel Jung
1 decade ago May 21, 2010 11:18am

Another vote for this. I'd like to see a simple addFilter( Filter ) for Containers. The BeanItemContainer.addContainerFilter(propertyId, term, ignoreCase, onlyMatchPrefix) is very restrictive.

Bruno Freitas
1 decade ago May 21, 2010 3:02pm

Hi Nicolas,

I would appreciate this feature too.
Maybe it also a good idea to add a feature request ticket to the trac.

Vaadin trac