Tony B
Tony B

Reputation: 949

using com.vaadin.data.util.filter.Or for filtering multiple values

I need to filter a Grid column based on multiple values? In other words, they choose 3 values from a dropdown, "Apple", "Orange", and "Meat". Then the filter chooses all matching grid lines that have Apple OR Orange or Meat in them. Would com.vaadin.data.util.filter.Or be good for this? Any examples on how to use it?

Upvotes: 1

Views: 97

Answers (1)

Leif Åstrand
Leif Åstrand

Reputation: 8001

Sounds like something along these lines:

theContainerUsedByTheGrid.addContainerFilter(new Or(
  new Compare.Equal("propertyId", "Apple"),
  new Compare.Equal("propertyId", "Orange"),
  new Compare.Equal("propertyId", "Meat")));

Upvotes: 3

Related Questions