0 Replies Latest reply on Jun 25, 2007 6:47 PM by aavb

    Navigation and redirect

    aavb

      Hello!

      I´m working on a project in which we use Ajax4JSF 1.1.1, Richfaces 3.0.1, Facelets 1.1.11 and MyFaces 1.1.5. These frameworks are relatively new to me, so I´m sorry if my question is silly.

      We want to use <a4j:include > to have Ajax navigation (that nice effect of displaying a message with <a4j:status> while the server processes the request and showing the whole page at once when it´s finished) through the JSF navigation system. We have a "template" page that contains nothing but the <a4j:include> tag, the (facelets templated) pages themselves (with, usually, <a4j:commandButtons> to trigger navigation) and the navigation rules. Everything works just fine *if* we define inside the navigation rules (indeed, the section for <a4j:commandButton> in the Ajax4JSF manual says that should be done). If we omit the declaration we usually get strange browser dependent errors concerning CSS styles (it looks like some styles haven´t been declared in some situations on some browsers). The problem with that solution is, of course, that we loose the Ajax "feeling" during navigation, since the browser posts a second request to get the final page (and our <a4j:status> message only displays during the first request-response cycle).

      So, I´d like to ask whether that´s a known issue or if it is probably a mistake I made in my project. If it´s an issue of the framework, is there another way of performing Ajax navigation (i.e. without sending a redirect back to the browser)?

      We also tried a different approach to navigation, by using an include of the form

      <a4j:include viewId="bean.currentPage" />

      and changing the value of the currentPage property of the backing bean. However, we had some strange problems with that: the framework really seemed to mix the two component trees, for we got components from both pages in the responses generated by clicking on an <a4j:commandButton>. Should this second approach have worked?

      Please let me know if you need any more info (such as code snippets).

      Thanks a lot!

      Best regards,
      Alexey