Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to control style of UI?  RSS feed

 
Ronald Johnson
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to JSF and I am curious how to control the UI so that the web pages will look exactly as the end customer wants it to be?
Stylesheets?

also, if someone can point me in direction of any websites/discussion with more info on this, I would be very grateful.
(i couldnt find anything when googling)
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF components all get rendered as HTML. And all components have a styleClass attribute that you can use to apply a style from a stylesheet or you can use the style attribute to apply an inline style. In short, yes, stylesheets.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In fact, some JSF components - like the Apache Faces popup calendar - basically won't work properly unless you've provided a good set of style definitions.

Add to that the fact that good JSF design doesn't include raw HTML and you almost have no other option than stylesheets.
[ January 15, 2007: Message edited by: Tim Holloway ]
 
Ronald Johnson
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the replies, some more question:

is it possible to generate a basic stylesheet somehow?
(since i guess that different implementations could generate different html code)

or do I have to do the hard work of looking at the generated html and figure out which elements that are used?

or should i use the style attribute in all tags in the .jsp file?

questions, questions, questions
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont really understand your question. As Gregg said , almost all JSF component has a style and styleclass attribute, you can use style attribute to asign a static style and styleclass to the class defined in the css file. Hope it explains !

Thanks,
[ January 18, 2007: Message edited by: Gregg Bolinger ]
 
A. Dusi
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, the styleClass attribute of all the components can take a dynamic value. For example, you can give
styleClass="#{yourBackingBean.currentCustomerStyle}".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!