0
我需要更改p:confirmDialog的默認行爲。在點擊Yes按鈕,它已經完成了請求傳球值1,點擊上,不,它已經完成了一個請求傳遞值0更改p的默認行爲:confirmDialog
<p:commandButton value="Consultar" onclick="consultar.show()">
<p:confirmDialog id="consultar" message="Foi feito a venda de recarga para esse cliente?" header="Confirmação" severity="alert" widgetVar="consultar">
<p:commandButton id="confirmaBtn" value="Sim" oncomplete="consultar.hide()" action="#{notaFiscalBean.consultarNota}">
<f:setPropertyActionListener target="#{notaFiscalBean.temRecarga}" value="1" />
</p:commandButton>
<p:commandButton id="recusaBtn" value="Não" oncomplete="consultar.hide()" action="#{notaFiscalBean.consultarNota}">
<f:setPropertyActionListener target="#{notaFiscalBean.temRecarga}" value="0" />
</p:commandButton>
</p:confirmDialog>
</p:commandButton>
此解決方案不起作用。任何人都有一個想法我該如何解決這個問題?
請,你可以把豆動作代碼嗎? – hlucasfranca
下面的答案解決了。謝謝。 –