tags:

views:

173

answers:

2

Hi there,

at the moment I've got a construct like this:

<div class="line">
   <label>Label</label>
   <h:inputText id="text-id1" required="true" ... />
</div>

Now when a validation exception is thrown I show them in a

<h:messages ... />

Is it possible to set the error class to my wrapping div?

+3  A: 
<div class="#{facesContext.maximumSeverity == null ? 'line' : 'errorLine'}">
Bozho
thanks Bozho! Works for me :)
asrijaal
is it possible to recieve a message for a UI component specific? Facescontext.getMessages(clientID) would match that but I wasn't able to get this by EL tried: #{facesContext.messages("id")} and #{facesContext.messages["id"]}
asrijaal
Just use `<h:message>` with a `for` attribute pointing to the component ID.
BalusC
+1  A: 

I know this isn't exactly what you asked, but i thought i should include it for completeness.

 <h:message errorClass="errorline" infoClass="line"/>
mR_fr0g