2011-01-10 73 views
1

我有我認爲是簡單的JSF導航設置,但是當我點擊h:commandButton頁面重新加載,而不是我想加載的頁面。在faces-配置片段是在這裏:JSF導航不工作在RichFaces

<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使用並載入next.xhtml文件。

回答

3

你的文件.xhtml不.jsf

你嘗試過:

<navigation-rule> 
    <from-view-id>/index.xhtml</from-view-id> 
    <navigation-case> 
     <from-outcome>hello</from-outcome> 
     <to-view-id>/next.xhtml</to-view-id> 
    </navigation-case> 
</navigation-rule> 
+0

天哪。你是對的。我的混淆來自於Web描述符,我曾用它來指定* .jsf的url模式和.xhtml的DEFAULT_SUFFIX。乾杯! – volvox 2011-01-11 10:59:44