문제

It concerns the following:

  1. There is a base stylesheet.css for the web site (by using a <link> tag).
  2. Depending on user is logged in the skin changes through SkinBean.setSkin("SKIN") when the user enters some parts of the web site.
  3. If the skin changes than also the loaded style sheet should be changed in 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}"/>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top