Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
Muhammad Taha
How to print only portlet content
15. Januar 2013 09:38
Antwort

Muhammad Taha

Rang: Junior Member

Nachrichten: 65

Eintrittsdatum: 1. Mai 2012

Neue Beiträge

Hi All,

How to print portlet content in JSF 2.0 portlet..
javascript window.print() is priting whole webpage. How to print only portlet content.

Thanks.
Muhammad Taha
RE: How to print only portlet content
24. Januar 2013 05:26
Antwort

Muhammad Taha

Rang: Junior Member

Nachrichten: 65

Eintrittsdatum: 1. Mai 2012

Neue Beiträge

Im able to print content based on class but I want to print based on its.. unable apply css based on Id

below is my code

<h:head>
<style type="text/css">
@media print
{
body * { visibility: hidden; }
.section_to_print * { visibility: visible; }
}
</style>
</h:head>

<h:body>
<h:panelGrid id="section_to_print">
<h:outputText value="#{backingBean.webContent}" escape="false" />
</h:panelGrid>
<h:commandButton value="Print" onclick="print()" />
</h:body>

Thanks
Muhammad Taha
RE: How to print only portlet content
24. Januar 2013 05:42
Antwort

Muhammad Taha

Rang: Junior Member

Nachrichten: 65

Eintrittsdatum: 1. Mai 2012

Neue Beiträge

correction:; its not <h:panelGrid id="section_to_print"> its <h:panelGrid class="section_to_print">
Neil Griffin
RE: How to print only portlet content
24. Januar 2013 10:57
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1997

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

This might be *close* to what you're asking for, but might not exactly meet your requirements.

We just added the ability to support Liferay "Print" mode, which is vendor-specific to Liferay Portal. For more info on how to use it, see FACES-1471.

The only file we had to fix in order to support this was GenericLiferayFacesPortlet.java but since it hasn't been released yet you would have to copy it into your portlet project.

When a portlet supports the Print mode, there will be a decoration for it that you can click on in the portlet titlebar.
Muhammad Taha
RE: How to print only portlet content
25. Januar 2013 03:37
Antwort

Muhammad Taha

Rang: Junior Member

Nachrichten: 65

Eintrittsdatum: 1. Mai 2012

Neue Beiträge

Thanks Niel.