Hatem Alimam
Hatem Alimam

Reputation: 10058

JSF h:outputStylesheet id attribute not working

I have a strange behavior of h:outputStylesheet. I need to give an Id to my stylesheet in order to change it via jQuery.

But the weird thing the tag doesn't render the "link" tag with an ID !

Here's my Code

<h:outputStylesheet  id="skinstyle" library="default" name="css/style.red.css" />    

and the output is this

<link type="text/css" rel="stylesheet" href="/MyApp/faces/javax.faces.resource/css/style.red.css?ln=default">    

I've got Mojarra 2.1.11 ,jBoss 7.1.3, Primefaces 3.5 (although Primefaces has nothing todo with this, just saying)!

Upvotes: 1

Views: 633

Answers (1)

Daniel
Daniel

Reputation: 37061

It looks like a bug in jsf implementation...

Meanwhile as workaround to access your link and modify you can try using jquery selector

For example:

$(document).find("link[href*='part_of_your_css_name']").attr("new_css_name"),

Upvotes: 2

Related Questions