【问题标题】:JSF commandButton make sure action is completedJSF commandButton 确保动作完成
【发布时间】:2013-02-26 10:58:06
【问题描述】:

在我进入下一页之前,如何确保这个 commandButton 的动作已经完成?

<a4j:commandButton value="Edit Skin" render="@all"
                action="#{helloBean.setCurrentSkin(skin)}"
                onclick="window.location.href = 'resources/html/Editor.xhtml';" />

【问题讨论】:

    标签: jsf onclick action commandbutton


    【解决方案1】:

    使用oncomplete 代替onclick:

    oncomplete="window.location.href = 'resources/html/Editor.xhtml'"
    

    另一种方法是在您的操作方法中重定向,只需返回字符串:

    return "Editor.xhtml?faces-redirect=true";
    

    【讨论】:

    • 是的,我已经尝试过了,但是我不会被转发。只执行操作
    猜你喜欢
    • 1970-01-01
    • 2012-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-30
    相关资源
    最近更新 更多