I want to print "the page" section, but the result is blank this is .xhtml file made with primefaces :
<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>
the command button :
<p:commandButton styleClass="mr-2 mb-2" value="Submit" update=":tabview:invoice-content" partialSubmit="true"/>
that is work,
But, the print button :
<p:commandButton styleClass="mr-2 mb-2" value="Cetak" type="button">
<p:printer target="invoice-content" />
</p:commandButton>
The result print is blank
You should reference the other form like
:invoice-content.See also: How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar"