Hi! I read a lot about MVP, tokens, places but still newbie and need
an advise about complex token strategy.
For example I have a Book object (that has its activity, place, view).
The book can be shown, edited and commented by its ID. The token need
to be switched to smth like
#bookPlace:234/show
#bookPlace:234/edit
#bookPlace:234/comment
Switching to edit and add comment need to be done without reloading
object (I mean that something like getPlaceController().goTo(new
BookPlace("edit")) will reload the object)
To switch to "comment" state of book's view without reloading I'm
trying to use
History.newItem(History.getToken() + "/comment", false); // token
goes to #bookPlace:234/comment, the view displays comment input form
To properly display #bookPlace:234/comment token In the Book activity
constructor I need parse the token using something like:
String[] tokenPath = place.getPlaceName().split("/");
this.bookID = tokenPath[0];
this.action = tokenPath[1];
Are there some helper classes to parse and map complex tokens? Am I
right using History.newItem(History.getToken() + "/comment", false);
to add "actions" to token?
Any links on the best complex tokens implementation with Places and
Activities are welcome.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.