6 Replies Latest reply on Apr 18, 2008 7:23 AM by Jens Mueller

    history.back question

    Jens Mueller Novice

      hi, im struggling with the following scenario:
      i'm using some partial page reloads with <a4j:include> which causes the well known ajax history problem. does somebody have a solution to that? does richfaces provide a mechanism for that common issue? are there other frameworks that can be used in addition?
      any idea very welcome!!

        • 1. Re: history.back question
          Sergey Smirnov Master

          Working with browser history is our of scope for RichFaces framework.

          • 2. Re: history.back question
            Jens Mueller Novice

            which means...??

            • 3. Re: history.back question
              Elmar Weber Newbie

              Hello,

              "Janson12" wrote:
              which means...??


              I think that it is not supported out of the box.


              As an answer to your original question:

              "Janson12" wrote:
              does somebody have a solution to that? does richfaces provide a mechanism for that common issue? are there other frameworks that can be used in addition?


              A, maybe little outdated, discussion and generic framework is available here:
              http://www.onjava.com/pub/a/onjava/2005/10/26/ajax-handling-bookmarks-and-back-button.html?page=1.

              An interesting blog entry with regard to JSF and Ajax is available at http://www.jroller.com/wesleyhales/entry/g4jsf_and_gwt

              ciao,
              Elmar

              • 4. Re: history.back question
                Jens Mueller Novice

                elmar, thanks a lot. i already skimmed thru both articles. Do you have any experiences with one of the mentioned frameworks?
                Meanwhile i think it's pure javascript problem:
                the only thing i want to do is to reload the previously (a4j-) included subside when the users presses the browser back button. My "ajax-area" is controlled via backing bean so it shouldn't be too difficult to create some sort of subside history. The thing that still needs to be done somehow is to add some listener to the back button. I now know this is not a 100%-richfaces topic, but as i think a lot of people benefit from partial page reload supported by richfaces this issue could still be interesting enough in this case.
                Cheers,
                janson

                • 5. Re: history.back question
                  Elmar Weber Newbie

                  Hello,

                  "Janson12" wrote:
                  elmar, thanks a lot. i already skimmed thru both articles. Do you have any experiences with one of the mentioned frameworks?


                  I've read something about the tools but not tested or used them.

                  "Janson12" wrote:
                  Meanwhile i think it's pure javascript problem:
                  the only thing i want to do is to reload the previously (a4j-) included subside when the users presses the browser back button. My "ajax-area" is controlled via backing bean so it shouldn't be too difficult to create some sort of subside history. The thing that still needs to be done somehow is to add some listener to the back button.


                  Based on the first article, as I see it, it is straight forward after set up of the JavaScripts:
                  - add an item to the history every time a corresponding AJAX request finishes (e.g. RichFaces oncomplete)
                  - add a listener (dhtmlHistory.addListener(historyChange);) and in the callback function you refresh JSF Ajax areas with information from the history event.

                  ciao,
                  Elmar


                  • 6. Re: history.back question
                    Jens Mueller Novice

                    Ok, i tried the example shipped with the RSH and realized that it is not working properly with IE7. Changes on the page are not added to history, so back button stays disabled. Gonna try the dojo.back function...