1

print アクションで action または actionListner メソッドを単独で実行する方法。たとえば、2 つのボタンをクリックせずに、請求書を印刷し、印刷請求書をバック Bean メソッドで印刷済みとしてマークすることは可能ですか?

<h:commandButton value="Print" actionListener="#{labBillController.markAsPrinted()}" >
    <p:printer target="panelBill" ></p:printer>
</h:commandButton>

上記のコードの両方のアクションは同時に発生していません。ajax を使用すると、actionListner メソッドが実行されます。非 ajux の場合、印刷のみで、メソッドの実行はありません。

4

1 に答える 1

1

これを使って

<h:commandButton value="Print" actionListener="#{labBillController.markAsPrinted()}" >
    <f:ajax execute="@this" />
    <p:printer target="panelBill" />
</h:commandButton>
于 2013-06-30T22:54:11.603 に答える