Wednesday, July 27, 2005

JSF Component Blushing

I've been looking for a way to blush some of my text components based on whether or not they passed JSF's built in validation of some input components rather than displaying error messages because they tend to mess up my layout and I don't like the global messages.

Found out from a guy on Javaranch you can do something similar to this:

styleClass="#{newIssueForm.summaryText.valid ? 'normal' : 'error'}"

Where normal and error are styles defined in your stylesheet. Works great. Thanks a lot to Mauro Castaldo for pointing this out to me.

No comments: