I have a form in which validation error message needs to be displayed below the input elements. The error needs to be highlighted by showing an error bubble around the error mes
The error needs to be highlighted by showing an error bubble around the error message ...
Just use
with a styleclass wherein you define the desired style.
with
.error {
border: 1px solid red;
background: pink;
}
...and the input text.
Just check if UIInput#isValid() is true
. Since JSF 2.0 the current component is available by implicit EL variable #{component}
.
As to the actual question about checking if there's a message for a certain client ID, then you may find this answer interesting. But I don't think that this is applicable in your particular case.
Update: as per the comments, you seem to want to style the containing component instead of the invididual components. In that case, do as follows: