1 2 Previous Next 15 Replies Latest reply on Jul 5, 2007 4:37 PM by Gavin King

    Does Seam really support back buttoning?

    Henri Karapuu Newbie

      I assumed that the back buttoning support would mean that the contents of the conversation scope would be rolled back to a previous state when using browser back button -- a.k.a continuations style, as in Spring Web Flows.

      For example I have a page, which shows a number, which is stored in conversation scope. The page has a button. I click the button, the number increases. Exciting. I click the button five times, and the number is now five. I click the browser back button three times, and the number is two. I click the increase button on the page.

      With all other 'back browser supporting' systems the result is 3.

      With seam, the result is 6, just as if i had stored the value in Session scope instead of Conversation scope.

      Is this the expected result? Meaning, did i understand what the back browser support means in Seam too optimistically, or am i just Doing Something Wrong?

      Thanks,

      Henri Karapuu

        • 1. Re: Does Seam really support back buttoning?
          Henri Karapuu Newbie

          Come on guys, it's elementary, i'm sure somebody has the answer!

          Does Seam support conversation scope rollback to previous state when browser back button is used or not? Details in the original post.

          Thanks,

          Henri Karapuu

          • 2. Re: Does Seam really support back buttoning?
            Brian Smith Apprentice

            You have to enable back button support on a page by page basis via pages.xml

            http://docs.jboss.com/seam/2.0.0.B1/reference/en/html/jbpm.html#d0e5005

            • 3. Re: Does Seam really support back buttoning?
              Henri Karapuu Newbie

              Thanks! But I thought that the back=enabled was only relevant when using jBPM?

              /Henri

              • 4. Re: Does Seam really support back buttoning?
                Brian Smith Apprentice

                Nope, I think you just have to use jPDL for navigation (aka Seam Navigation). That is in no way dependent on using jBPM.

                • 5. Re: Does Seam really support back buttoning?
                  Henri Karapuu Newbie

                   

                  "smithbstl" wrote:
                  Nope, I think you just have to use jPDL for navigation (aka Seam Navigation). That is in no way dependent on using jBPM.


                  Ok, so lets assume i use jPDL to define the navigation rules. Is it the conversation scope that gets rolled back to previous state, or the process scope?

                  If i define a stateful session bean with conversation/process scope will the bean state get rolled back?

                  Thanks,

                  Henri Karapuu

                  • 6. Re: Does Seam really support back buttoning?
                    Brian Smith Apprentice

                    Ok, I guess I told you wrong. jPDL pageflows are related to jBPM because they are installed using the jBPM namespace in components.xml

                    <core:jbpm>
                     <core:pageflow-definitions>
                     <value>pageflow.jpdl.xml</value>
                     </core:pageflow-definitions>
                    </core:jbpm>


                    But you don't have to use jBPM in order to use pageflows. Now if you are not defining any jBPM processes, there really is no "process" scope. What will get rolled back using the back button is the Long Running conversation that is started in the pageflow defined in pageflow.jpdl.xml NOT pages.xml, I was mistaken in my previous post, sorry.

                    • 7. Re: Does Seam really support back buttoning?
                      Brian Smith Apprentice

                      The easiest way to test this is to try it out with a simple app.

                      • 8. Re: Does Seam really support back buttoning?
                        Henri Karapuu Newbie

                        Ok thanks for the help.

                        • 9. Re: Does Seam really support back buttoning?
                          Gavin King Master

                           

                          "hkarapuu" wrote:
                          Does Seam support conversation scope rollback to previous state when browser back button is used or not?


                          No. In my opinion this is not the true semantics of "back". Back is purely navigational, it should not change the underlying state.

                          • 10. Re: Does Seam really support back buttoning?
                            Henri Karapuu Newbie

                             

                            No. In my opinion this is not the true semantics of "back". Back is purely navigational, it should not change the underlying state.


                            I think there are many equally 'correct' or 'true' semantics for back button.

                            Other frameworks saying "back button support" mostly implement the other ('state rollback') semantics. Seam's "back button support" is more like separating the context per browser window, right?

                            In practice the state rollback semantics has proven to be extremely valuable.

                            Would you be open for discussion about adding that as a configurable alternative?

                            Regards,

                            Henri Karapuu

                            • 11. Re: Does Seam really support back buttoning?
                              Gavin King Master

                               

                              "hkarapuu" wrote:
                              No. In my opinion this is not the true semantics of "back". Back is purely navigational, it should not change the underlying state.


                              I think there are many equally 'correct' or 'true' semantics for back button.

                              Other frameworks saying "back button support" mostly implement the other ('state rollback') semantics. Seam's "back button support" is more like separating the context per browser window, right?

                              In practice the state rollback semantics has proven to be extremely valuable.

                              Would you be open for discussion about adding that as a configurable alternative?


                              Not really, other frameworks are wrong here (and unperformant). In Seam, you get effect you want to achieve using "state rollback" by instead using nested conversations. It will take a bit of thinking for you to really "get" this.

                              Basically what Seam says is that you should be able to freely back-and-forward through a wizard without "losing" state that you already entered. But at certain well-defined points, you "acquire" state that should be released if you back up out of it. (An example of such a point is adding a new "child" object, or something.) These "well-defined points" are the beginnings of new nested conversations.

                              You need to spend some time thinking it out before you really "feel" this approach.

                              • 12. Re: Does Seam really support back buttoning?
                                Henri Karapuu Newbie

                                 

                                "Gavin King" wrote:
                                Not really, other frameworks are wrong here (and unperformant). In Seam, you get effect you want to achieve using "state rollback" by instead using nested conversations. It will take a bit of thinking for you to really "get" this.


                                Yes i got the style, it's in fact same as what i used in my custom implementation of conversation scope in the sense that the state to be saved needs to be marked explicitly. Which is all good.

                                The problem was that, apparently due to the bug in @Begin(nested=true) as discussed in the other thread, the behavior did not work ...

                                I'll give it a spin again and see how things go. Thanks.

                                Ps. If Bill continues his postings like today [1], we'll be soon unable to use Seam for political reasons. I don't personally give a shit, but others do.

                                [1] http://www.theserverside.com/news/thread.tss?thread_id=46065#235878

                                /Henri Karapuu

                                • 13. Re: Does Seam really support back buttoning?
                                  Gavin King Master

                                   

                                  The problem was that, apparently due to the bug in @Begin(nested=true) as discussed in the other thread, the behavior did not work ...


                                  Yes, thanks for spotting this. I will get it fixed.

                                  If Bill continues his postings like today [1], we'll be soon unable to use Seam for political reasons. I don't personally give a shit, but others do.


                                  I don't tell Bill what to do or say. Frankly I find most of the stuff he posts on TSS amazingly intemperate, unpersuasive, unproductive and inflammatory. But then, lots of people violently disagree with stuff I post as well, so who am I to judge others?

                                  It's a deep, ancient cultural tradition at JBoss to let people speak their mind and I'm certainly not going to be the one to try to get us acting more "corporate".



                                  • 14. Re: Does Seam really support back buttoning?
                                    Henri Karapuu Newbie

                                     

                                    "gavin.king@jboss.com" wrote:

                                    Yes, thanks for spotting this. I will get it fixed.


                                    I didn't spot it, i was just the victim :)


                                    I don't tell Bill what to do or say. Frankly I find most of the stuff he posts on TSS amazingly intemperate, unpersuasive, unproductive and inflammatory. But then, lots of people violently disagree with stuff I post as well, so who am I to judge others?


                                    Fair enough. Can't say that i agree or understand your company's policy of allowing that kind of behavior in public, but not much i can do about it.

                                    /Henri Karapuu

                                    1 2 Previous Next