java - Update Javascript source from backbean JSF -
i have javscript in xhtml file
<script src="test1.js"></script>
now have couple of other javascripts well. themes.
i want give users flexibility change them (javascript name) frmo drop-down box .
i tried way
<script src="#{testbean.jsname}</script>
since going ajax update have update section , updated with
<h:panelgrid id="jsname"> <script src="#{testbean.jsname}</script> </h:panelgrid>
this not inside form .
when try
<p:commandbutton value="generate" actionlistener="#{tbean.generategraph}" update="jsname"></p:commandbutton>
it doesn't work says couldn't find jsname
.
i put gride inside form wont throw error script name still remain same.
does have better idea or other way achieve it?
if try update component inside form have use absolute id of panelgrid otherwise primefaces try update id jsname
inside form. when want use absolute id have preced :
. try following button:
<p:commandbutton value="generate" actionlistener="#{tbean.generategraph}" update=":jsname"/>
Comments
Post a Comment