你可以为primefaces打印机模块设置多个目标吗

Tar*_*tel 5 jsf primefaces

我需要能够隔离 JSF 页面中的 2 个位置以发送到 Primefaces 打印机组件。不幸的是,我在包括 Primefaces 文档在内的任何地方都找不到如何执行此操作的示例。这个命令肯定比只接收一个目标更灵活吗?

使用 Primefaces 6.2

我试过这个:

...

<p:commandButton value="Print in a PRINTER FREINDLY format">
     <p:printer target="area1" />
     <p:printer target="area2" />
</p:commandButton>

<p:outputPanel id="area1">
...
</p:outputPanel>

...bunch of code between these two output panels...

<p:outputPanel id="area2">
...
</p:outputPanel>

...
Run Code Online (Sandbox Code Playgroud)

没有错误显示但是只有首先放置的目标显示在打印页面中。

这样做:

<p:printer target="area1 area2" />
Run Code Online (Sandbox Code Playgroud)

导致错误。

有人可以告诉我如何在 Primefaces 中为打印机命令设置多个目标吗?

谢谢你。

小智 0

在表单中添加您的区域并使用:

<p:printer target=":form:printable" />
Run Code Online (Sandbox Code Playgroud)