【发布时间】:2012-05-22 21:50:29
【问题描述】:
我正在尝试使用删除按钮实现 JSF 表。这是显示对话框的 JavaScript:
function dialog(a){
$("<div />", {
text: a
}).dialog({
width: 600,
buttons: {
"Ok": function() {
$("#myHiddenButtonID").click();
$(this).dialog("close");
},
"Cancel": function(event) {
$(this).dialog("close");
event.preventDefault();
}
}
});
}
当用户从对话框中确认时,我使用第二个隐藏按钮删除行:
<!-- hidden button -->
<h:commandButton id="myHiddenButtonID" value="DeleteHiddenButton" action="#{bean.deleteSelectedIDs}" style="display:none">
<f:ajax render="@form" execute="@form"></f:ajax>
</h:commandButton>
<!-- the button -->
<h:commandButton value="Delete">
<f:ajax execute="@form" onevent="dialog('demo test')"></f:ajax>
</h:commandButton>
当我单击删除按钮时,会出现确认删除表行的对话框。然后我点击是没有任何反应。我想隐藏的按钮 id 是问题,但是当我尝试修复它时,什么也没有发生。未调用托管 bean 方法。
【问题讨论】:
-
你能发布表单在你的页面中是如何定义的
标签: java javascript jsf jsf-2 jquery-dialog