Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to change style of h:messages in code

 
Balaji Kadam
Ranch Hand
Posts: 31
Hibernate Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

in my jsf page i have added message using h:messages which will show message for all component including info and error messages.

but i want info messages to be display as blue and error as red.

i was trying to apply css class but it shows same for all messages

anybody know how to do this?

Thanks
Balaji
 
Louis Bros
Ranch Hand
Posts: 54
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The '<h:messages />' component has the attributes 'infoClass' and 'errorClass' class you could use.

Ta
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18164
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a general rule, anything that affects appearances in JSF is handled by CSS. JSF figured that there was already something that worked, so why re-invent it?

Of course, JSF View Definition Language is a higher-level VDL than raw HTML is, so there are often specialized sub-component CSS attributes such as the ones that Louis mentioned.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic