Highlight is a helper component which highlights all invalid UIInput components by adding
an error style class to them. Additionally, it by default focuses the first invalid UIInput component. The
<o:highlight /> component can be placed anywhere in the view, as long as there's only one of it.
Preferably put it somewhere in the master template for forms.

Constructor Detail

Highlight

Method Detail

encodeChildren

Visit all components of the current UIForm, check if they are an instance of UIInput and are not
UIInput.isValid() and finally append them to an array in JSON format and render the script.

Note that the FacesContext.getClientIdsWithMessages() could also be consulted, but it does not indicate
whether the components associated with those client IDs are actually UIInput components which are not
UIInput.isValid(). Also note that the highlighting is been done by delegating the job to JavaScript
instead of directly changing the component's own styleClass attribute; this is chosen so because we
don't want the changed style class to be saved in the server side view state as it may result in potential
inconsitenties because it's supposed to be an one-time change.