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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -