I'm sure I am missing something straightforward and simple, but in xpages, using a tabbed panel, who do I get all the tabs to print when the users prints the page?

有帮助吗?

解决方案

You can use a Dojo tab container (part of the extension library) instead of the standard tabbed panel. With the Dojo tab container the content of all tabs is loaded at once (in opposite to the standard tabbed panel, as Tim said), so you could do some CSS magic to make all tabs visible when printing.

Tim recommends building a separate XPage for printing, and I second that. Organize the content of the tabs in custom controls, create a new XPage for example with the suffix "_print" and include the custom controls in it without the tabbed panel. Then create a button, link or whatever in the first XPage which simple opens an XPage with the same name plus "_print" in a new window.

In the "_print" Xpage you can use a "window.print" after the page loads to open the print dialog automatically.

This technique has the advantage that you can style the printing exactly as needed. You can even control which content to include when printing by using the visible/rendered property and compute to render controls only when the current page name does not include "_print".

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top