1 Reply Latest reply on Dec 6, 2007 3:42 AM by stuartm1971

    Navigation from a4j:include, problems

    stuartm1971

      I have the following setup and problem. In very simple terms I have a page which includes another page which I want to be the first of a set of pages to navigate like a wizard but all within the initial including page.

      <

      %--Main page--%>
      <f:view>
       <h:form>
       <a4j:include viewId="/web/page1.jsp" />
       <h:commandButton value="Home" action="home" />
       </h:form>
      </f:view>


      page1.jsp

      <h:outputText value="Page1" />
      <a4j:commandButton value="Next" action="next"/>
      



      page2.jsp

      <h:outputText value="Page2" />
      <h:outputText value="Other details relating to page 2..." />
      <a4j:commandButton value="Back" action="back" />



      the faces-config.xml contains the following

      <navigation-rule>
       <from-view-id>/web/page1.jsp</from-view-id>
       <navigation-case>
       <from-outcome>next</from-outcome>
       <to-view-id>/web/page2.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      
       <navigation-rule>
       <from-view-id>/web/page2.jsp</from-view-id>
       <navigation-case>
       <from-outcome>back</from-outcome>
       <to-view-id>/web/page1.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      
       <navigation-rule>
       <from-view-id>/web/*</from-view-id>
       <navigation-case>
       <from-outcome>home</from-outcome>
       <to-view-id>/web/home.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>




      The navigation works as planned between page1 & page 2 and the 'Home' button works as expected while within page1. However, if I navigate to page2 the home button no longer works if pressed. Instead it just refreshes the page as if the action was null. Press it again and it does work.

      I've noticed that if page1.jsp and page2.jsp contain the same content, ie if both have the same number of JSF tags, than this problem doesn't occur but I obviously I want my two pages to contain varied content.

      I'm using RichFaces 3.1.0.

      Any help would be greatly appreciated.

      Thanks.