【发布时间】:2011-06-06 16:45:04
【问题描述】:
我有我认为是简单的 JSF 导航设置,但是当我点击 h:commandButton 时,页面重新加载,而不是我想要加载的页面。 faces-config sn-p 在这里:
<navigation-rule>
<from-view-id>/index.jsf</from-view-id>
<navigation-case>
<from-outcome>hello</from-outcome>
<to-view-id>/next.jsf</to-view-id>
</navigation-case>
</navigation-rule>
index.xhtml 文件包含以下内容:
<f:view>
<a4j:region id="topRegion">
<rich:page pageTitle="myapp" markupType="xhtml" id="top">
<f:facet name="header">
<h:form>
<rich:toolBar height="45" itemSeparator="disc">
<rich:toolBarGroup location="left">
<h:form name="selectForm">
<h:panelGrid columns="5" style="padding: 2px;">
<h:outputText style="text-align: center" value="Node Select " />
<h:selectOneMenu id="nodes" value="#{MyBacking.chosenNode}">
<f:selectItems value="#{MyBacking.nodes}" />
</h:selectOneMenu>
<h:commandButton value="Retrieve" styleClass="ctrlBtn"
id="retrieveBtn" style="margin-bottom: 2px;"
action="hello"
image="/img/btnRetrieve26.png" />
</h:panelGrid>
</h:form>
</rich:toolBarGroup>
</rich:toolBar>
</h:form>
就这么简单。谁能告诉我为什么它不起作用?
据我所知,h:commandbutton 应该使用 hello 的 from-outcome 并加载 next.xhtml 文件。
【问题讨论】: