[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
Environment:

Apache Tomcat 7.0.34 running in Windows 8


Tags: composite-component, outputStyleSheet

 Description   

Situation:
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:interface>
<composite:attribute name="theme" required="false" default="rose" />
...
</composite:interface>

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

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

{theme}

/calendar.css" />
...
</composite:implementation>

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="#

{'rose'}

"), 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:
http://stackoverflow.com/questions/7386344/evaluating-the-rendered-attribute-of-houtputstylesheet-inside-a-composite



 Comments   
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.

Consumer:
<my:facelet hasPermission="#

{true}

" />

CC:

Doesn't work (gets rendered):

<h:panelGroup rendered="#

{!cc.attrs.hasPermission}

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

But this works:

<h:panelGroup rendered="#

{cc.attrs.hasPermission? false : true}

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

Generated at Fri May 22 15:41:52 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.