Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Setting text of outputText in JSF to another text color

 
Ranch Hand
Posts: 40
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

is it possible in JSF to conditionally set a text in an <h:outputText .. to another color like red?

And how can i do that?

Thanks

Wim>
 
Saloon Keeper
Posts: 25465
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you can! Like virtually all display-related features of JSF, JSF defers to CSS rather than trying to re-invent the concept.

The tag attributes "style" and "styleClass" provide this feature and correspond to the HTML attributes "style" and "class". JSF calls it styleClass both as a clarity feature and because "class" is a reserved word in Java and it made it easier for the JSF implementers to code if they renamed it.
 
Eat that pie! EAT IT! Now read this tiny ad. READ IT!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic