• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

css backbean

 
Dura Hurtado
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi anybody knows if I could set a new value for a css like this:

.clase{
color: blue;
font-size: 20px;
}

I mean

clase{
color: #{Bean.property};
font-size: 20px;
}

I need set values in a css dinamycally from a database or backbean.

¿Any idea?

Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18100
51
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know that "clase" is a good name for a class - I got confused thinking you were doing some sort of special operation there - but you can do this, providing you are careful.

If you include the css from a separate CSS file (recommended), the variable substitution will not be done and it won't work. However, you should be able to make it work if you include the CSS inline on the JSF page (not recommend, though).

More commonly, however, people usually either select from a collection of css files ("skinning") or set the class name (or style information) on the tag they which to change styles on - for example, I have a display like so:


The backing bean code is:


 
Dura Hurtado
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer, then for example me would like set the style x, throught back bean but I want that the next time I load the page(from any machine), it shows the styles set in my last setting session. Then I have developed it using a DDBB.

But it is very slow, ¿is no there a way to improve that?

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic