Fórum

styleClass of <h:message> is ignored

Tim Kieritz, modificado 9 Anos atrás.

styleClass of <h:message> is ignored

New Member Postagens: 9 Data de Entrada: 14/03/14 Postagens Recentes
I try to write validation for one of my components and show the validation error in a red box.
I have the following code in my xhtml:
<h:inputtext id="someText" value="..." validator="..." />
<h:message for="someText" styleClass="alert alert-error" />

That code validates the input text and shows an validation error if the input is invalid.
Problem is that the validation error shows up in a blue box.
Looking at it I found out that it is rendered as
<span class="portlet-msg-info" id="yui_patched_...">Some Validation Error Message</span>

I would have expected that the value I entered under styleClass goes into the class attribute of the span

I have tried different values for "styleClass" but it seems to ignore those.
I could use the style attribute but that would be a horror to maintain.

Has anybody an idea why it ignores the styleClass attribute?
How can I set the class attribute of the span?
thumbnail
Kyle Joseph Stiemann, modificado 9 Anos atrás.

RE: styleClass of <h:message> is ignored (Resposta)

Liferay Master Postagens: 760 Data de Entrada: 14/01/13 Postagens Recentes
Hi Tim,
Thanks for reporting this, it is a bug. I am working on a fix right now. You can track the issue here: https://issues.liferay.com/browse/FACES-2157

- Kyle