[JAVASERVERFACES_SPEC_PUBLIC-1195] cc.attrs not avaiable when rendering h:outputStyleSheet Created: 24/May/13  Updated: 23/Sep/14

Status: Open
Project: javaserverfaces-spec-public
Component/s: Components/Renderers
Affects Version/s: 2.1
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: tiagoperes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Apache Tomcat 7.0.34 running in Windows 8

Tags: composite-component, outputStyleSheet


A composite component has its attributes declared with the "composite-attribute" tags, one of these attributes is "theme", used to specify the css file to be used by the component.

<composite:attribute name="theme" required="false" default="rose" />

At the component's implementation I try to import the css file using the "h:outputStyleSheet" tag.

<h:outputStylesheet library="components" name="calendar/#


/calendar.css" />

Expected behavior:
If no attribute "theme" is specified by the page calling the component, "h:outputStylesheet" should import "calendar/rose/calendar.css". If a theme is specified it should import the specified theme.

Actual behavior:
"h:outputStylesheet" tries to import "calendar//calendar.css", no matter if a theme was specified or not.

My thoughts:
I tried to specify the theme directly inside the EL expression (name="#


"), it worked, so it's not an expression problem. I think the cc.attrs variables are not available when "h:outputStylesheet" is processed.

There's a similar problem described in Stack Overflow:

Comment by Ed Burns [ 01/Aug/14 ]

Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

Comment by Manfred Riem [ 01/Aug/14 ]

Setting priority to Minor

Comment by jpangamarca [ 23/Sep/14 ]

The same happens for h:panelGroup. I'm using JSF 2.2 (org.jboss.spec.javax.faces.jboss-jsf-api_2.2_spec, Implementation-Version: 2.2.6), Wildfly 8.1.0, WAR deployment.

<my:facelet hasPermission="#


" />


Doesn't work (gets rendered):

<h:panelGroup rendered="#


" layout="block">
<h:outputText value="Unauthorized" />

But this works:

<h:panelGroup rendered="#

{cc.attrs.hasPermission? false : true}

" layout="block">
<h:outputText value="Unauthorized" />

Generated at Tue Jul 07 11:22:04 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.