Forums de discussion

New WIndow from Resource Action handler?

thumbnail
Andew Jardine, modifié il y a 12 années.

New WIndow from Resource Action handler?

Liferay Legend Publications: 2416 Date d'inscription: 22/12/10 Publications récentes
I think I might be doing something weird, but what the hell.

In my view.jsp I have a resource action defined. When you click a print link, it is fired and goes to the portlet class. In that class I have my @ProcessResource defined. The portlet class instantiates an export provider of a specific type, in this case HTMLExportProvider. It sets the output stream of the exporter to be the response.getPortletOutputStream() value. I collect up the data and image for export, and invoke the provider. Here is the part I am stuck on.

The response is written without issue, but to a new tab in my browsers. I want to output it to a new (smaller) window. Normally I would do this with a print.css, but what they want produced for a print view actually contains more data than what is displayed on the page.

Does anyone know if I can open a new window programatically from the server side? The only thing I can think of is including JS in the template to then spawn a new window from the new tab, but then you end up with a orphaned tab that serves no purpose.

Any ideas?