2

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?

2 Answers 2

4
<div class="#{facesContext.maximumSeverity == null ? 'line' : 'errorLine'}">
Sign up to request clarification or add additional context in comments.

2 Comments

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"]}
Just use <h:message> with a for attribute pointing to the component ID.
1

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.