是否可以在以下组件(Seam按钮)中添加确认框?
我试过这个(见下面的代码):但是当我点击确定/取消时没有任何反应。
当我删除onclick
时,一切正常但没有确认。
代码:
<s:button value="Delete this"
id="updateTM"
view="/secure/CustomerDelete.xhtml"
onclick="if (! confirm('Really start deletion of this customers ?') ) { return false;}; return true; "
action="#{customerHome.initAsyncProcess}" />
答案 0 :(得分:0)
解决它(与Seam butons相同的布局):
<h:commandButton
onclick="if (! confirm('Really want to do that?')) return false"
value="Delete it"
action="#{customerHome.startAsync}">
</h:commandButton>
然后在我的bean中我执行以下操作:
public String startAsync(){
this.initAsyncProcess();
return "/secure/CustomerDuplicateDelete.xhtml";
}