1 Reply Latest reply on Oct 9, 2009 11:14 AM by Dietrich Schulten

    seam-numberguess Back navigation broken?

    Dietrich Schulten Newbie
      I am just working through the tutorial examples, searching for an example with Back button handling that does something sensible in stateful flows. If I understand correctly, Seam promises to handle Back either by keeping the user to the current state or by restoring the flow from the cid within the URL, if the user comes back from a different context. So far this seems not to work for me.

      I found that the numberguess is extremely weird when backing and refreshing in the application.

      For starters:

      Enter 50, app shows a hint to enter a lower/higher value within reduced range, like "I'm thinking of a number between 51 and 100. You have 9 guesses."
      Hit Back
      Entry page is shown again
      Enter 60, app shows a message Illegal navigation and the same hint as before
      Hit Back
      Entry page is shown again, but the buttons are "garbled"

      If you mix in a Refresh, more weird things happen, but this should be enough for now.

      My understanding is that the numberguess example is stateful in the sense of this section from the refguide:
      "in the stateful model, using the back button is interpreted as an undefined transition back to a previous state. Since the stateful model enforces a defined set of transitions from the current state, the back button is not permitted by default in the stateful model! Seam transparently detects the use of the back button, and blocks any attempt to perform an action from a previous, "stale" page, and simply redirects the user to the "current" page (and displays a faces message)."

      I would have expected that Seam keeps me on the page where the hint is shown with my last entered guess, IOW, that the back button just redirects to a page corresponding to the current state as before.

      What is wrong here? Do I have to disable caching somehow to run this example? If so, how?
      And why are the buttons garbled on the second attempt? (hopefully I will be able to upload a screenshot somehow)