Hi Mahmoud,

Yes, this is very possible to do. Have any widget add a history
handler, and watch for any history change event, and then fire the
widget state accordingly as you see fit. I like doing it this way. You
can pass any number of parameters in to change the widgets/app state.

domain.tld#historyToken?[?params1=a&params2=b]
I do this in my core project I am building.
http://code.google.com/p/gwt-examples/source/browse/trunk/Core/src/org/gonevertical/core/client/global/QueryString.java

Here is how I manage the default History Observations:
http://code.google.com/p/gwt-examples/source/browse/trunk/DemoCoreEngine/src/com/gawkat/demo/client/DemoCoreEngine.java
private void initHistory() {
    String historyToken = History.getToken();

    if (historyToken.length() == 0) {
      History.newItem("account_Things");
    }
  }

This will watch/observe the the querystring events (url):
History.addValueChangeHandler(this);

Hope that helps,
Brandon Donnelson
http://gwt-examples.googlecode.com


On Apr 23, 8:38 pm, Mahmoud <[email protected]> wrote:
> Hello,
> I have followed the MVP structure while developing my project.
> Once I hit the site URL, the History Manager loads the module by
> inserting the default token to the history stack and then from there
> the user can redirect himself to any part of the application by
> changing the History token, which is basically the bit that comes
> after the pound symbol (#) in the URL
>
> My problem is: I'm unable to redirect a user to a specific token
> without having to go through the default token and from there to
> anywhere I want.
>
> In other words, the URLs history usual follows this:http://domain#defaultToken
> and from there I can go tohttp://domain#page1orhttp://domain#page2
> without any problem.
>
> But if i want to go directly tohttp://domain#page1i will be
> redirected to the default token which ishttp://domain#defaultToken...
> mainly due to this snippet of code:
>
>                 this.container = container;
>
>                 if ("".equals(History.getToken())) {
>                         History.newItem("defaultToken");
>                 } else {
>                         History.fireCurrentHistoryState();
>                 }
>
> So my question is: Is it possible to redirect a user to any part of
> the application without having to start from the defaultToken page?
> And can we pass in parameters using the URL only (i.e: how can the
> user hit the following link without 
> errors?:http://domain#page3?param1=a&param2=b)
> ? How those it work?
>
> To concertize the problem, I'm trying to implement an "activation"
> link that if once the user clicks on it he will activate his account
> given the userID and a encrypted code 
> (i.e:http://domain#activate?userID=12&code=ht2oj34j2k5j6pk3
> )
>
> Any advice will do,
> Cheers,
> Mahmoud
>
> --
> 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 
> athttp://groups.google.com/group/google-web-toolkit?hl=en.

-- 
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.

Reply via email to