1

In Omnifaces it's possible to render messages on your own, using <o:messages var="msg">, but this only works if you use the var attribute. If you specify a custom message with message attribute in combination with var attribute, all messages will be displayed instead of the custom one. Is it possible to render custom message on your own in any way?

Example

This

<o:messages var="msg" for="form">
    <div>#{msg.summary}</div>
</o:messages>

renders as

<div>form:select: Validation Error: Value is required.</div>

What I would like to do is render this:

<o:messages var="msg" for="form" message="Error!">
    <div>#{msg.summary}</div>
</o:messages>

as:

<div>Error!</div>
2
  • Why don't you just put <div>Error!</div> directly under <o:messages> ? If you absolutely need it inside a variablle you could also just use <c:set> rather than relying on the message attribute. Apr 14, 2021 at 23:11
  • Because then I lose some of the handy attributes of <o:messages ..>.
    – semrola
    May 20, 2021 at 5:54

0

Your Answer

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

Browse other questions tagged or ask your own question.