ok, now I see the issue.....but, wouldn't using
window.location.replace also "lock" the user into the site in the same
way - when the user goes back to the first page the browser would then
fire them forwards again to the location.replace url?

Maybe the key is to not have the #Home token and treat the empty
history token as if the token in the url was #Home (which I think is
what Thomas is saying?), then you avoid the "lock-in" although you
don't explicitly show the user they are "home".

//Adam

On 30 Mar, 13:47, Ian Bambury <[email protected]> wrote:
> Hi Thomas,
> I don't see how that helps. If I understand, all you are saying is that if
> the token is blank, change it to 'Home'. But right now, if it is blank, I
> set up the default (the first item in the menu and any nested menus) and so
> I get to the default page that way.
> At the end of setting up the site dependent on what the token is, I still
> have to write out a history token - which in your example will be 'Home' and
> this will add a history record. So I will end up with a blank one followed
> by 'Home'. So if someone clicks 'Back' they will be back at the blank one.
> Which will create 'Home' again and lock them into my site, which is what I
> am trying to avoid.
>
> This is exactly the situation I have already. So I tried to 'replace' the
> token if the current one is blank. But Window.Location.replace() doesn't
> work in Safari or Chrome or Opera.
>
> Hence my original post.
>
> Or am I still missing something?
>
> Ian
>
> http://examples.roughian.com
>
> 2009/3/30 Thomas Broyer <[email protected]>
>
>
>
> > On 29 mar, 22:43, Ian Bambury <[email protected]> wrote:
> > > 2009/3/29 Thomas Broyer <[email protected]>
>
> > > >  Am I clearer?
>
> > > I don't know. I know I'm not :-)
>
> > > OK. Where do you see this bit of code living?
>
> > > String token = History.getToken();
> > > if (token.length() == 0) {
> > > token = HIS_INTRO;}
>
> > > onHistoryChanged(token);
>
> > in your onModuleLoad (assuming your EntryPoint is your
> > HistoryListener, and you have a single HistoryListener).
>
> > Or you can do this:
> > public void onHistoryChanged(String token) {
> >   if (token.length() == 0) {
> >      token = "Home";
> >   }
> >   // do your history processing
> > }
> > and in onModuleLoad just call:
> > History.fireCurrentHistoryState()
> > (assuming you only have one HistoryListener, or you'll have to include
> > the same "if" code in all of them that care)
>
> > It all depends where your HistoryListener is located and if you have a
> > single or several listeners, but the key is: whenever you "get" the
> > empty string (History.getToken() == ""), do as if it were "Home".
--~--~---------~--~----~------------~-------~--~----~
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