Change default behavior of p element: confirmDialog

0

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!

    
asked by anonymous 08.04.2016 / 14:45

1 answer

0

I made the same question in Stackoverflow in English and had the answer there.

If anyone else needs it, follow the link.

link

    
08.04.2016 / 19:42