0 Replies Latest reply on Sep 20, 2010 11:01 PM by Akaine Harga

    RichFaces with normal web context behavior

    Akaine Harga Novice

      Recently I had a lot of different problems that could be considered bugs in some cases and lack of features in others related to RF AJAX page forwarding:

      - JS errors and wrong RF elements functionality in some popular browsers related to fixed context (Safari, Chrome);

      - loss of application context caused by forced page refresh and history back in some browsers (Firefox);

      - compatibility with some 3rd party frameworks (PrimeFaces, BIRT, Facelets);

       

      Most of these problems can be avoided by using page forwarding in pure JSF environment (no AJAX submits) or by Seam implementation which has conversational state for page redirection. But the idea here is to avoid Seam by all means possible.

       

      So the main question is:

      - Is it possible to use AJAX submits to redirect or forward from page1 to page2 without implementing Seam but still be able to keep the sent data from the page1 and bring it to page2 while changing the web context according to the target page and without relying on session beans?

       

      I'll try to eplain myself in more detail. For ex. we have a structure:

      [web]
      -- [pages]
      ---- [dir1]
      ------ page1.xhtml
      ---- [dir2]
      ------ page2.xhtml

      We submit some data on page1 and according to set nav rules we are being moved to page2.

       

      Case 1, JSF (non-AJAX) submit (using h:commandButton for ex.):

      - the context (url) changes from myapp/pages/dir1/page1.faces to myapp/pages/dir2/page2.faces

      - all works fine except that we can't do all the wonderfull stuff RF offers us with a4j:commandButton for ex. like conditional AJAX form validation, and other AJAX-based events.

       

      Case 2, AJAX submit with page forwarding set in nav rules (using a4j:commandButton for ex.):

      - the context stays as it was from the 1st page. In fact if the whole application is made this way it's possible to have myapp/ in the url string all the time. Many developers actually want this for greater security.

      - many RF components and even some simple JS functions (drop down menus, modal panels, etc.) just stop working in some popular browsers at this moment

       

      Case 3, the same AJAX submit but with page redirection rule:

      - the context changes as in Case 1, but all the sent data is lost since it is a real page redirect, so the REQUEST object is getting wiped out

       

       

      I know JSF and RF offers custom listeners usage, maybe the answer to my questio is there...

       

      Thanks in advance and sorry for rather lame and large post.