我有 jQuery UI 确认对话框:
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;
}
}
});
}
由 JSF2 html 调用:
<a4j:commandButton action="#{userBean.makeSomething()}" type="button" onclick="if (fnValidateUsersList()) {return fnComfirm('Delete User', 'Bla bla')}" />
但我无法从此函数中获得真/假值。我在这个网站上看到了很多关于它的问题,尝试了所有这些问题,但仍然没有成功。
更新:输出<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">