我想打印“页面”部分,但结果是空白 这是用 primefaces 制作的 .xhtml 文件:
<p:tabView id="tabview">
<p:tab title="Per Nasabah">
<div class="grid table-demo">
<div class="col-12">
<h:form>
<div class="card">
<div class="ui-fluid formgrid grid">
<div class="field col-12 md:col-4"></div>
<div class="field col-12 md:col-2">
<label><br/></label>
<p:commandButton styleClass="mr-2 mb-2" value="Submit" update=":tabview:invoice-content" partialSubmit="true"/>
</div>
<div class="field col-12 md:col-2">
<label><br/></label>
<p:commandButton styleClass="mr-2 mb-2" value="Cetak" type="button">
<p:printer target=":tabview:invoice-content" />
</p:commandButton>
</div>
<div class="field col-12 md:col-4"> </div>
</div>
</div>
</h:form>
</div>
</div>
<div class="grid">
<div class="col">
<div style="margin-top: 10px" class="card">
<h:form id="invoice-content">
<div class="invoice-custom">
<!--The page-->
</div>
</h:form>
</div>
</div>
</div>
</p:tab>
</p:tabView>
命令按钮:
<p:commandButton styleClass="mr-2 mb-2" value="Submit" update=":tabview:invoice-content" partialSubmit="true"/>
这就是工作,
但是,打印按钮:
<p:commandButton styleClass="mr-2 mb-2" value="Cetak" type="button">
<p:printer target="invoice-content" />
</p:commandButton>
结果打印为空白