myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Bischoff <jbisch...@klkurz.com>
Subject Re: css messages issue
Date Wed, 01 Nov 2006 19:29:04 GMT
 > But, the text is black and default, not css applied.
 >

I would hope so! You haven't told any of the JSF components to apply 
some CSS to their output. In order to do so, you need to use the 
styleClass and/or the style attributes. h:message and h:messages have 
additional attributes to define the CSS used depending on the message 
severity, e.g. errorClass, errorStyle, warnClass, warnStyle.

Use the "Class" attributes for referencing a CSS class, "Style" for 
inline CSS.

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

Mick Knutson wrote:
> I am not able to see my messages in the defined css style.
> 
> ...
>    <script type='text/javascript'
> src='/tro/skins/default/scripts/generic.js'> </script>
> ...
> 
>                        <h:inputText 
> value="#{UserBackingBean.user.firstName}"
> required="true"
>                                     id="firstName"/>
>                        <h:message for="firstName" />
> 
> ...
> 
> 
> Then my output when I have an error is:
> 
>                    <TD>
>                        <input id="_idJsp0:firstName"
> name="_idJsp0:firstName" type="text" value="" />
>                        <span
> id="_idJsp0:failures">&quot;firstName&quot;: Error during model data
> update.</span>
>                    </TD>
> 
> 
> But, the text is black and default, not css applied.
> 
> 
> here is the css:
> 
> #failures { color: red; min-width:300px; max-height:200px; overflow:auto; }
> 
> 



Mime
View raw message