确认并重定向到JSF中的其他视图

确认并重定向到JSF中的其他视图,jsf,seam,Jsf,Seam,是否可以将确认框添加到以下组件(Seam按钮)? 我尝试过这个(见下面的代码):但是当我点击OK/Cancel时,什么都没有发生。 当我删除onclick时,一切正常,但没有确认 代码: 解决了这个问题(与Seam Buton的布局相同): 用这个解决了它(与Seam butons的布局相同): <s:button value="Delete this" id="updateTM" view="/secure/CustomerDelete.xhtm

是否可以将确认框添加到以下组件(Seam按钮)? 我尝试过这个(见下面的代码):但是当我点击OK/Cancel时,什么都没有发生。 当我删除
onclick
时,一切正常,但没有确认

代码:


解决了这个问题(与Seam Buton的布局相同):

用这个解决了它(与Seam butons的布局相同):

<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}" />
<h:commandButton
    onclick="if (! confirm('Really want to do that?')) return false"
    value="Delete it"
    action="#{customerHome.startAsync}">
</h:commandButton>
public String startAsync(){
        this.initAsyncProcess();
        return "/secure/CustomerDuplicateDelete.xhtml";
}