I've got a problem, concerning the "rendered" attribute of a h:outputStylesheet inside my composite component.
<h:outputStylesheet rendered="#{cc.attrs.value == 'somevalue'}" library="css" name="mainDark.css" target="head" />
does not work, even if the EL evaluates to 'true'. Whereas
<h:outputText rendered="#{cc.attrs.value == 'somevalue'}" value="rendered = true" style="color: red;" />
is getting properly rendered/not rendered.
While this is already quite confusing, it gets even worse:
- if I replace the EL by just 'true' or 'false', the attribute works as intended.
- if I replace the EL by some other evaluation it works too. For example #{someBean.somevalue == 'somevalue'} or just #{1 > 0}
Am I missing something, or might this just be some weird bug? I'm running on Tomcat v7.0 and JSF2.0
<h:outputStylesheet library="css" name="#{cc.attrs.enable == 'true' ? 'mainDark.css' : 'empty.css'}" target="head" />
But i'd still be interested, why this happens. – Christian Voß