I'm using com.sun.faces
version 2.1.18
. I'm displaying a list of questions and for some questions (based on the database ID) I want to insert some dynamic Javascripts.
According to the h:outputScript
tag specification the name
attribute is of type: javax.el.ValueExpression
(must evaluate to java.lang.String
).
However, this code is working for me:
<ui:repeat value="#{js.questionScripts[question.id]}" var="script">
<h:outputScript name="myScript.js" library="js" target="head"/>
</ui:repeat>
But this code isn't:
<ui:repeat value="#{js.questionScripts[question.id]}" var="script">
<h:outputScript name="#{script}" library="js" target="head"/>
</ui:repeat>
The #{question}
comes from a surrounding <ui:repeat>
iteration over a list of questions.
I added an output to see if #{script}
was not empty, but it contained the correct resource name.
Any ideas on how to solve this or implement an alternative?