0
I created this confirm:
<script type="text/javascript" language="javascript">
function salvarAntes(){
var r=confirm("Deseja confirmar?");
if(r){
return true;
} else {
return false;
}
}
</script>
And call in my commandButton:
<p:commandButton value="Confirma" process="@form" onclick="if(salvarAntes() #{bean.salvar});"/>
The idea is to call the method in the bean only if my javascript is true. The problem is that in onclick you say you can’t find the method. Does anyone know how I can solve?