I need to change the default behavior of the p: confirmDialog element. When you click yes, it must complete the request by passing a value and clicking on no, you must complete the request by passing another value.
<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>
But this solution is not working. Anyone have any idea what I can do? Thanks!