-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a modal window that contains a link and iframe. When the "Print" link is clicked, I would like to print the content of the iframe. How is this possible ? Please help.
<toolbarbutton label="Print" />
<iframe id="frameContent" width="100%" height="80%"></iframe>
Thank you
Neetu
Executions.getCurrent().sendRedirect(iframe-src, "_blank");
PeterKuo,
I am not sure how I can handle it in Java. Could you please help ?
Henrichen,
Is it possible to do it without opening a new window. I prefer to see a print dialog when I click on the print link. Also, I am not sure how the frame source can be passed as it is dynamic based on a listbox selection and I use the following code to set the frame content.
FileInputStream stream = new FileInputStream(file);
AMedia media = new AMedia(null, null, null, stream);
((Iframe)getFellow("fileContent")).setContent(media);
The file is on the network.
Thank you
Neetu
Neetu,
1. I don't know other ways other than sendRedirect() to "hide" those parts you don't want to print.
2. Since you know where the file is (in server side), you shall be able to give an URL and forward to the file contents.
Here is another thread that discussed print issue. Maybe helpful.
http://www.zkoss.org/forum/index.zul#path%3DlistComment%3BdiscussionId%3D6423%3BcategoryId%3D14%3B
OK. Now I ran into another problem with the print button.
The print button and the frame are in a modal window. This modal window is closable and has the onClose event defined as follows.
onClose="self.visible = false; event.stopPropagation();"
I closed the modal window and re-opened it. Nothing happens when I click on the print button.
TIA
Neetu
Asked: 2008-12-23 13:51:22 +0800
Seen: 1,794 times
Last updated: Jan 16 '09