jsf 2 - To pass JSF(primefaces) managed bean variable to javascript function -


I have JSF / Primase managed bin. I'm trying to run the Managed Bean variable in the Javascript function within the same Managed Bean. I'm not successful, someone can help me get this job done.

My Managed Bean Code Snippet

  reportName = report [0]; Url = "http: //cvgapp42q/Reports/Pages/Report.aspx ItemPath =% 2fLPSR% 2f?" + ReportName; {RequestContext.getCurrentInstance () try Execute ("window.open ('# {repBean.url}')"); } Grip (Exception E) {// TODO Auto generated blocking block e.printStackTrace (); }  

url is the variable that I refer to in the javascript function window.open () to use expression # {repBean.url} I am trying to

Thank you in advance

Just put your javascript code into your page Panel on:

  & lt; H: Panel Group id = "ScriptPanel" & gt; & Lt; Script & gt; Window.open ('# {repBean.url}'); & Lt; / Script & gt; & Lt; / H: panelGroup & gt;  

and update this panel after your AJAX request, by using update = "scriptPanel" on your respective prefix component.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -