0
我的h:commandLink不起作用。我在faces-config.xml中有一个导航规则,在我的bean中有一个String方法doSave()。我不知道为什么它只是重新加载页面而不跳入doSave()方法。jsf - commandLink不调用bean方法
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页面美好景色的内容,但所有你需要知道是我认为的形式和按钮。
重新加载可能是转换/验证失败的一个指标。你的表单中是否有'h:messages'标签? – 2012-03-30 10:12:29
不,我在窗体中只有一些'h:selectOneRadio','t:inputText'和一个'h:dataTable'标记。我有一个类似的网页,它有效,但我找不到差异 – 2012-03-30 10:51:08
然后尝试添加'h:messages'。它显示所有的验证错误,你会对发生的事情有更多的了解。 – 2012-03-30 10:52:19