PrimeFaces CommandButton 在对话框中不起作用

PrimeFaces CommandButton is not working in Dialog

我需要你的帮助来解决对话框中 CommandButton 的问题,因为我在操作中调用了一个名为 UpdatePrint() 的方法,但它没有被调用。 jsf页面代码如下:

<h:form id="Requests">
.
.
.
<p:commandButton update=":Requests:#{hr.dialogueName}" oncomplete="PF('#{hr.certificateDialogue}').show()" icon="ui-icon-search" title="View">
<f:setPropertyActionListener value="#{hr}" target="#{hrd.selectedRequest}"/>
</p:commandButton>
.
.
<p:dialog header="cert1" widgetVar="cert1" modal="true" showEffect="fade" hideEffect="fade" resizable="true">
<p:outputPanel id="HRCEEN" style="text-align:center;">
</p:outputPanel>
 <p:commandButton value="Print" action="#{hrd.UpdatePrint}" type="button" icon="ui-icon-print"  style="display:block;margin-bottom: 20px">
<p:printer target="HRCEEN"/>
</p:commandButton>
</p:dialog>
.
.

<p:dialog header="cert2" widgetVar="cert2" modal="true" showEffect="fade" hideEffect="fade" resizable="true">
<p:outputPanel id="HRSSEN" style="text-align:center;">
</p:outputPanel>
<p:commandButton value="Print" action="#{hrd.UpdatePrint}" type="button" icon="ui-icon-print"  style="display:block;margin-bottom: 20px">
<p:printer target="HRSSEN"/>
</p:commandButton>
</p:dialog>

</h:form>

我尝试了不同的方法,但没有成功,因为当我在更新中引用时,它告诉我找不到更新中的部分。

 <p:commandButton update=":Requests:#{hr.dialogueName}" oncomplete="PF('#{hr.certificateDialogue}').show()" icon="ui-icon-search" title="View">
<f:setPropertyActionListener value="#{hr}" target="#{hrd.selectedRequest}"/>
</p:commandButton>

由于 type="button" 属性,未调用操作方法 - 没有提交到服务器。删除 type,然后将触发操作(按钮将采用默认的 submit 类型)。