wood burning stoves 2.0*
The moose likes JSF and the fly likes css backbean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "css backbean" Watch "css backbean" New topic
Author

css backbean

Dura Hurtado
Ranch Hand

Joined: Feb 16, 2011
Posts: 120
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

Joined: Jun 25, 2001
Posts: 16019
    
  20

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:



Customer surveys are for companies who didn't pay proper attention to begin with.
Dura Hurtado
Ranch Hand

Joined: Feb 16, 2011
Posts: 120
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: css backbean