I am trying to understand Places, PlaceTokenizer, and how and when to parse the token. I read about them, look at examples, watch there execution, and still I think I'm missing something. (The examples I follow seem not to fit me--they seem either trivial or too complex to follow.)
I have a Place, MyPlace. It may get a null token, or it may get a token with one or more items--state, id, etc. Examples would be "LIST" or "SHOW_ID;1234". I read from Thomas that "parsing should be done in a PlaceTokenizer" (https://groups.google.com/d/msg/google-web-toolkit/M5jCI-_95mQ/JJcClisInRoJ). However if when I do my parsing in MyPlace.Tokenizer.getToken(), the MyPlace that is passed to MyActivity contains the previous values for state and id. My trace looks like
instantiate MyPlace(LIST)
AppActivityMapper.getActivity(): com.foo.bar.client.place.MyPlace@be4139
instantiate MyActivity, place: com.foo.bar.client.place.MyPlace@be4139
starting MyActivity
MyView presenter set
It seems that the instantiation method for MyPlace must parse the token or calls to place.getState() and place.getId() will return values no yet set.
I can see MyPlace.Tokenizer.getToken() being called--though I'm not sure from where--but place.getState() does not return an updated value unless in start() wait with Scheduler.get().scheduleDeferred() and test the value in execute().
I never see MyPlace.Tokenizer.getPlace() called. What is it used for? *WHEN* is it used (never from what I see).
Currently I'm parsing the token in MyPlace's instantiation method, but it doesn't feel right.
Can anyone clarify this for me?