0

我的 h:commandLink 不起作用。我在 faces-config.xml 中有一个导航规则,在我的 bean 中有一个字符串方法 doSave()。我不知道为什么它只重新加载页面而不跳转到 doSave() 方法。

jsf页面

<h:form id="surveyForm">
    <div class="srvButton">
        <h:commandLink action="#{surveyBean.doSave}" value="#{msg.srvButton}" />
    </div>
</h:form>

面孔配置

<navigation-rule>
    <from-view-id>/pages/survey.xhtml</from-view-id>
    <navigation-case>
        <from-outcome>success</from-outcome>
        <to-view-id>/pages/surveyFinish.xhtml</to-view-id>
    </navigation-case>
</navigation-rule>

public String doSave() {

    // Kundendaten speichern
    saveCustomer();     

    return "success";
}

我清理了 jsf 页面中的内容以获得更好的视图,但您需要知道的只是我认为的表单和按钮。

4

1 回答 1

0

我刚刚解决了我的问题。我用标签替换了所有c:if标签ui:fragment,它起作用了!也许,这可能会让你感兴趣c:foreach vs ui:repeat 感谢@matthandy 的努力..

于 2012-04-02T11:45:41.220 回答