Monday, February 27, 2012

Accessint GWT's HIstory Stack

Been searching for an answer to the following problem.... I have an application with 2 Places: "Index" and "Edit" each have representative tokens that carry state information.

My desire:
I want for the user to be able to return to the last "Index" state after many possible "Edit" states, so say these tokens are on the history stack:
1. INDEX:--23--pg1
2. INDEX:--23--pg2
(user sees the document they want to edit and thus enter EDIT place)
3. EDIT:--docFOO
(see anther document from a widget in the EDIT place)
4. EDIT:--docBAR
(and another)
5. EDIT:--docBING

Now arrives the problem... I want the user to be able to go back to the last INDEX state. Right now my solution is to carry the token (in this example "INDEX:--23--pg2") around on the query string as part of the EDIT token. What I don't like about this solution is that if the user bookmarks a particular EDIT token the INDEX token that is part of the EDIT token gets bookmarked as well obviously, and i cannot tell whether the user really came from that INDEX state or not.

Preferred solution: Search the History stack for the last INDEX token.

Alternative solution: Use a cookie with a fairly short expiration time to store the last INDEX token.

Thoughts? Is there a way to loop through the History stack to find particular tokens?

Thanks in advance.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment