5 Replies Latest reply on Apr 22, 2009 7:31 PM by gonorrhea

    pages.xml and back button enabled

    gonorrhea

      I got this from Seam in Action (section 7.6.4):


      <page view-id="/CreateRepairCase.xhtml" redirect="true" back="enabled"/>



      Eclipse is telling me these msg's:


      cvc-complex-type.3.2.2: Attribute 'redirect' is not allowed to appear in element 'page'.




      cvc-complex-type.3.2.2: Attribute 'back' is not allowed to appear in element 'page'.



      I am using Seam 2.0.2-FP.


      So is the example from the book based on Seam 2.1 only?


      Also, I noticed previously that the back button works in the hotel booking app but the pages.xml does not have back="enabled" in it...


      What's the best way to handle this?  thx.

        • 1. Re: pages.xml and back button enabled
          gonorrhea

          btw:


          <?xml version="1.0" encoding="UTF-8"?>
          <pages xmlns="http://jboss.com/products/seam/pages"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
          
                 no-conversation-view-id="/home.xhtml"
                 login-view-id="/login.xhtml">
          ...
          </pages>

          • 2. Re: pages.xml and back button enabled
            gonorrhea

            Ok so I just realized (after examining the XSDs), that this is required:


            http://www.jboss.com/products/seam/pageflow-2.0.xsd


            not this:


            http://www.jboss.com/products/seam/pages-2.0.xsd


            The former has the back attribute for page element, the latter does not...


            Does this mean we must use pageflows with our Seam apps to allow user to use browser back/forward buttons??

            • 3. Re: pages.xml and back button enabled
              gonorrhea


              Basically when a page belongs to a long-running conversation (LRC), a conversation identifier (cid) is sent as part of the response when the page is rendered. When you leave that page and navigate around the application or even to another site, you can use the back-button to return to the page. When you then click a link or button on the page, the cid is sent back with the form allowing Seam to identify the conversation associated with the page. The request is then processed within the context of the conversation.

              How this works is described in-depth with diagrams and discussion in chapter 8 of the book. I hope that helps.

              source: http://www.coderanch.com/t/439300/JBoss/Seam-Back-button-Navigation


              Well, we have a Seam app here (another team dev'd it) that doesn't behave properly when you use the browser's back/forward buttons (data is cached when you click different links and you see unexpected pics/data).


              Is there a definitive and easy solution to this?  pageflows or not???

              • 4. Re: pages.xml and back button enabled
                gonorrhea

                could somebody point to a Seam example app that handles the back button properly??

                • 5. Re: pages.xml and back button enabled
                  gonorrhea

                  ok, the seam booking app seems to handle the back/forward browser buttons properly.


                  I found this as well:



                  Can Seam handle back-button navigation?

                  Seam's nested conversation model makes it really easy to build complex, stateful applications that tolerate use of the back button. This article describes nested conversations in detail.

                  http://www.seamframework.org/Documentation/CanSeamHandleBackbuttonNavigation


                  but when I searched the booking source code, there is no reference to 'nested'.


                  in the article it says, it just works but I really think it depends on how you design and code your app b/c ours doesn't work properly in terms of browser back/forth navigation...