~ l3dx$
On Nov 18, 11:12 am, Andrew Uglev <andrew.ug...@gmail.com> wrote:
> 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 complextokens? Am I
> right using History.newItem(History.getToken() + "/comment", false);
> to add "actions" to token?
>
> Any links on the best complextokensimplementation with Places and
> Activities are welcome.
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?