views:

29

answers:

1

I feel recurrent the need of building a search formula or filter panel using logic and expression.

Here are some example expressions: search all item with price >= $100 and available in stock. filter all files with (name like *.log or name = toto.txt) and modification date < 2 hours from now

I know how to implement such a search/filtering pattern for performing the search, but I hand code the gui part, losing a lot of possibilities (and/or stuff, ...).

Does someone know a generic way of building this kind of dynamic form allowing user to create its own request graphically ? In this kind of form the user will be able to select which criteria are relevant, enter its own values and create logical expression.

+1  A: 

The JBoss Rules Guvnor interface provides a way to build your own criteria (albeit not for searching). If you have an instance of Thunderbird at hand, it's search criteria builder is quite similar. This is a fairly common pattern, but it's not one I tend to implement for enterprise applications.

Tomislav Nakic-Alfirevic
Thanks for the Drools Guvnor link, that's a great source for rules management. I have a deeper look on this.
Guillaume