Use <a4j:loadStyle>
instead of <link>
tag and use rendered
attribute as below.
<a4j:loadStyle src="stylesheet.css" rendered="#{myBean.booleanProperty}"/>
<a4j:loadStyle src="stylesheet-alt.css" rendered="#{!myBean.booleanProperty}"/>
سؤال
It concerns the following:
stylesheet.css
for the web site (by using a <link>
tag).SkinBean.setSkin("SKIN")
when the user enters some parts of the web site.stylesheet-alt.css
.Is there a quick and simple solution for changing the style sheet depending on used skin in RichFaces?
I will be glad if someone helps.
(This question is not about how to change the skin in RichFaces in general)
المحلول
Use <a4j:loadStyle>
instead of <link>
tag and use rendered
attribute as below.
<a4j:loadStyle src="stylesheet.css" rendered="#{myBean.booleanProperty}"/>
<a4j:loadStyle src="stylesheet-alt.css" rendered="#{!myBean.booleanProperty}"/>