Forums de discussion
How to add print button within popup and print that popup content?
Gaurang Sheladia, modifié il y a 13 années.
How to add print button within popup and print that popup content?
Regular Member Publications: 159 Date d'inscription: 15/02/09 Publications récentes
Hi All,
Here i have one query, currently i am trying to add print button in Liferay Popup. While clicking on print button it should print only the content which popup has.
Has anyone tried or any approach would be really appreciated.
Thanks in advance.
Thanks,
Gaurang
Here i have one query, currently i am trying to add print button in Liferay Popup. While clicking on print button it should print only the content which popup has.
Has anyone tried or any approach would be really appreciated.
Thanks in advance.
Thanks,
Gaurang
jelmer kuperus, modifié il y a 13 années.
RE: How to add print button within popup and print that popup content?
Liferay Legend Publications: 1191 Date d'inscription: 10/03/10 Publications récentes
I guess the easiest way would be to open the portlet in popup mode in a new window, then pass in a parameter that triggers a window.print(); on load of the page
eg.
eg.
<a href="<portlet:renderURL windowState=" pop_up">
<portlet:param name="print" value="true" />
" target="_blank"
link
</a>
<% if (ParamUtil.getBoolean(request, "print", false) { %>
<script type="text/javascript">
window.onload = function() {
window.print();
}
</script>
<% } %>
Gaurang Sheladia, modifié il y a 13 années.
RE: How to add print button within popup and print that popup content?
Regular Member Publications: 159 Date d'inscription: 15/02/09 Publications récentes
Hi Jelmer,
Thanks for your quick prompt.
I have resolved my issue with using action url in liferay to call same Action class and new window for the print the popup.
Thanks,
Gaurang
Thanks for your quick prompt.
I have resolved my issue with using action url in liferay to call same Action class and new window for the print the popup.
Thanks,
Gaurang
mohammed ansari, modifié il y a 12 années.
RE: How to add print button within popup and print that popup content?
New Member Publications: 11 Date d'inscription: 08/02/11 Publications récentesGaurang Sheladia:
Hi Jelmer,
Thanks for your quick prompt.
I have resolved my issue with using action url in liferay to call same Action class and new window for the print the popup.
Thanks,
Gaurang
Hey Gaurang can you share what you did..Thanks
Gaurang Sheladia, modifié il y a 12 années.
RE: How to add print button within popup and print that popup content?
Regular Member Publications: 159 Date d'inscription: 15/02/09 Publications récentes
Hi Ansari,
I have call the same url while call any popup.
Let me know for any query.
I have call the same url while call any popup.
Let me know for any query.
janakiram n, modifié il y a 10 années.
RE: How to add print button within popup and print that popup content?
New Member Publications: 2 Date d'inscription: 11/03/13 Publications récentes
i too have similar problem, but not this,i need to print filled form data when clicked on print button after submitting
alex wom, modifié il y a 12 années.
RE: How to add print button within popup and print that popup content?
Regular Member Publications: 218 Date d'inscription: 04/05/09 Publications récentes
Hi Jelmer I tried to do this, and I print popup by using
<aui:script>
print();
</aui:script>
And it prints, but prints an empty page ... To be more precise my print code is:
boolean print = false;
if (Validator.isNotNull(viewMode)) {
print=true;
articleDisplay = JournalContentUtil.getDisplay(
themeDisplay.getScopeGroupId(), journalArticle.getArticleId(), journalArticle.getTemplateId(), viewMode, themeDisplay.getLanguageId(),
themeDisplay);
%>
<%= articleDisplay.getContent() %>
<aui:script>
print();
</aui:script>
<%
}
<aui:script>
print();
</aui:script>
And it prints, but prints an empty page ... To be more precise my print code is:
boolean print = false;
if (Validator.isNotNull(viewMode)) {
print=true;
articleDisplay = JournalContentUtil.getDisplay(
themeDisplay.getScopeGroupId(), journalArticle.getArticleId(), journalArticle.getTemplateId(), viewMode, themeDisplay.getLanguageId(),
themeDisplay);
%>
<%= articleDisplay.getContent() %>
<aui:script>
print();
</aui:script>
<%
}
jelmer kuperus, modifié il y a 12 années.
RE: How to add print button within popup and print that popup content?
Liferay Legend Publications: 1191 Date d'inscription: 10/03/10 Publications récentes
But does the journal content article display ?
alex wom, modifié il y a 12 années.
RE: How to add print button within popup and print that popup content?
Regular Member Publications: 218 Date d'inscription: 04/05/09 Publications récentes
Yes, if I drop print() I see a popup with the article, but the popup contains all the page framework. The difference with journal content print is that when I print the popup contains only the article display without the page framework: but I don't know how to eliminate it.
jelmer kuperus, modifié il y a 12 années.
RE: How to add print button within popup and print that popup content?
Liferay Legend Publications: 1191 Date d'inscription: 10/03/10 Publications récentes
Notice that in my example i use windowState="pop_up"
what that does is that it usually eliminates the header / footer etc.
Or on a technical level it will use portal_pop_up.vm instead of portal_normal.vm from your theme
what that does is that it usually eliminates the header / footer etc.
Or on a technical level it will use portal_pop_up.vm instead of portal_normal.vm from your theme
alex wom, modifié il y a 12 années.
RE: How to add print button within popup and print that popup content?
Regular Member Publications: 218 Date d'inscription: 04/05/09 Publications récentes
Yesss! It's ok