I have a JSF/primefaces managed bean.I am trying to pass managed bean variable to JavaScript function within the same managed bean but i am not successful. Can someone please help me in achieving this task.
My managed bean code snippet
reportName=report[0];
url="http://cvgapp42q/Reports/Pages/Report.aspx?ItemPath=%2fLPSR%2f"+reportName;
try {
RequestContext.getCurrentInstance().execute("window.open('#{repBean.url}')");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
url is the variable which i am trying to refer using the expression #{repBean.url} in the javascript function window.open()
Thanks in advance