9 Replies Latest reply on Mar 3, 2009 2:36 PM by ZJ DA

    Navigation problem with rich:menuItem

    ZJ DA Newbie

      Hi. I am using the rich:menuItem to navigate to different perspectives. However, a part of old page appends to new page.

      My rich:menuItem in header.xthml code:

      <rich:menuItem submitMode="server" value="Home" action="#{sessionInfo.perspectiveAction}" immediate="true" icon="/images/home2.gif">
       <a4j:actionparam name="perspective" value="home" assignTo="#{sessionInfo.perspective}" />
      </rich:menuItem>
      <rich:menuItem submitMode="server" value="Workspace" action="#{sessionInfo.perspectiveAction}"
      icon="/images/myfaces.gif">
       <a4j:actionparam name="perspective" value="workspace" assignTo="#{sessionInfo.perspective}" />
      </rich:menuItem>
      


      My Action:
       public String perspectiveAction() {
       return this.perspective;
       }
      


      My home.jsp and workspace.jsp (same header and footer, only different content components):
      ?xml version='1.0' encoding='UTF-8' ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
      <head>
      ...
      </head>
      
      <body style="margin: 0px;">
      <f:view>
       <f:loadBundle basename="com.ds.ipark.resource.jsf_messages" var="messages" />
       <a4j:include id="header" viewId="/pages/shared/header.xhtml" />
      ...
      other components
      ...
       <a4j:include id="footer" viewId="/pages/shared/footer.xhtml" />
      
      </f:view>
      </body>
      </html>
      


      My navigation rule:

       <navigation-rule>
       <from-view-id>/pages/home.jsp</from-view-id>
       <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/pages/user/workspace.jsp</to-view-id>
       </navigation-case>
       <navigation-case>
       <from-outcome>failure</from-outcome>
       <to-view-id>/pages/home.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      
       <navigation-rule>
       <from-view-id>/pages/shared/header.xhtml </from-view-id>
       <navigation-case>
       <from-outcome>workspace</from-outcome>
       <to-view-id>/pages/user/workspace.jsp</to-view-id>
       </navigation-case>
       <navigation-case>
       <from-outcome>home</from-outcome>
       <to-view-id>/pages/home.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      


      While I am in home.jsp and click on "Workspace" menuItem, it navigate to the workspace.jsp. However, the content and footer portions (not header) are appended to the workspace.jsp on IE. On FireFox, it displays the following error:

      XML Parsing Error: xml declaration not at start of external entity
      ....
      <body style="margin: 0px;"><span id="header"><?xml version='1.0' encoding='UTF-8' ?>
      ---------------------------------------------^
      


      Any suggestion is appreciated. Thanks,
      -ZJ