I have jQuery UI confirm dialog:
function fnComfirm(title, content) {
$("#dialog:ui-dialog").dialog("destroy");
$("#dialog-confirm p").html(content);
$("#dialog-confirm").dialog({
title: title,
resizable: false,
height: 200,
width: 486,
modal: true,
buttons: {
"OK": function() {
$( this ).dialog("close");
return true;
},
Cancel: function() {
$( this ).dialog("close");
return false;
}
}
});
}
Called by JSF2 html:
<a4j:commandButton action="#{userBean.makeSomething()}" type="button" onclick="if (fnValidateUsersList()) {return fnComfirm('Delete User', 'Bla bla')}" />
But I can't get true/false value from this function. I saw many questions here on this site about it, tried all of them, but still get no success.
UPDATE:
output of <a4j:commandButton>
:
<input type="button" value="Make Something" onclick="jsf.util.chain(this,event,"if (fnValidateUsersList()) {return fnComfirm('Delete User', 'Bla bla')}","RichFaces.ajax(\"frm:j_idt25\",event,{\"incId\":\"1\"} )");return false;" name="frm:j_idt25" id="frm:j_idt25">