JSFPRINTER
JSFPRINTER

Reputation: 1

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.

Upvotes: 0

Views: 3031

Answers (2)

Sean
Sean

Reputation: 981

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

Upvotes: 0

BalusC
BalusC

Reputation: 1108642

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');

Upvotes: 0

Related Questions