开发者

JSF Open new window and display bean data

I am running JSF 2.0 and the latest version of Primefaces 2.2RC1 I believe. I am trying to create a printer friendly window. When the user clicks on a p:commandLink I want a new window to open and display a xhtml file I have named printView.xhtml.

Now I can get the window working fine using JavaScript window.open but when I open the new window it will not render any values it just displays everything as #{myBean.value}. Does anyone know how to properly open a window and extend the current scope of the application into that window so I can call all of my managed beans properly and开发者_如何学编程 display the values etc. etc.


it just displays everything as #{myBean.value}

So, the FacesServlet wasn't been invoked. It is the one responsible for doing the JSF works. You need to ensure that the URL in the window.open() matches the url-pattern of the FacesServlet as definied in web.xml.

If it is for example *.jsf, then you need to open it as follows:

window.open('printView.jsf');


Just an FYI, 2.2.RC1 had some bugs. You'll want version 2.2.RC2.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜