Search Expressions in standard JSF since 1.0

Neither the advanced search expressions of BootsFaces nor their PrimeFaces counterparts work with the components of the base libraries out-of-the-box. However, it's possible to define a JSF bean or an EL expression resolving the advanced search expressions. BootsFaces, in particular, provides an optional facelets decorator that allows you to use the advanced search expressions without further ado. From a technical point of view, that's a fairly convoluted approach because the underlying base library (Mojarra or MyFaces) still doesn't support the search expressions, but from a user's perspective you won't notice the difference.

Basic usage (also works without BootsFaces)

Let's start with the basic idea, which required a lot of keystrokes, but doesn't require you to configure the decorator. BootsFaces provides a JSF bean method resolving search expressions. All you have to do is to wrap the call to this method around your search expressions:

Live preview

This even works without BootsFaces if you copy the folder to your project.

Advanced usage (only works with BootsFaces)

By configuring and activating the BootsFaces facelets decorator, you can use search expressions with the for attribute of many standard JSF components, such as <h:message />, <h:messages />, and <h:outputLabel />. From a programmers perspective, you won't see much of a difference between the two classes of components. The only difference is that some of BootsFaces search expressions are very powerful, which makes them slower than a simple id.

For some reason, the facelets decorator does not work with the <f:ajax /> facet, so you have to resolve the search expressions yourself, as shown below:

Live preview