You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Andreas Hartmann <an...@apache.org> on 2012/08/27 10:53:47 UTC

Conditional rendering of h:outputScript

Dear MyFaces community,

I'm trying to render a group of outputScript tags based on a condition:

<h:outputScript rendered="#{layoutController.isShowEditor(page)}"
   library="svg-edit" name="svgedit.compiled.js" target="head"/>

While this works fine for other tags, the outputScript tag doesn't seem 
to support conditions in the rendered attribute. Whenever I user an 
expression as the attribute value, the outputScript is not rendered. I 
can only switch it on/off using boolean literals.

What am I doing wrong?

Another question: Is it possible to group multiple 
outputScript/outputStylesheet tags and render the whole group based on a 
condition?

TIA for any hints!

Best regards,
Andreas

-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01