In my XHTML file, I have included Javascript like this:
<script src="test1.js"></script>
Additionally, I have a few other Javascript files which are actually themes.
I want to provide users with the option to change the theme (Javascript name) from a drop-down box.
I attempted to do it this way:
<script src="#{testBean.jsName}</script>
Since this will be an Ajax update, I updated the section with:
<h:panelGrid id="jsName">
<script src="#{testBean.jsName}</script>
</h:panelGrid>
It's important to note that this is not within the form.
When I try:
<p:commandButton value="Generate"
actionListener="#{tBean.generateGraph}" update="jsName"></p:commandButton>
It does not work and gives an error saying it couldn't find jsName
.
If I place that grid inside the form, the error goes away but the script name remains the same.
Does anyone have a better idea or alternative method to achieve this?