Hi Adam,

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


No because say the history is SiteA, SiteB, SiteC

And SiteC has a link to http://mysite.com/

Before anything happens on mysite, there is a history record added

SiteA, SiteB, SiteC, http://mysite.com/

I want to replace the http://mysite.com/ with http://mysite.com/#Home

so we have

SiteA, SiteB, SiteC, http://mysite.com/#Home

so the back button will take you back to SiteC - and this works OK with IE
and FF

But...

if the replace doesn't work (Safari, Chrome, Opera), you end up with

SiteA, SiteB, SiteC, http://mysite.com/, http://mysite.com/#Home

and the back button takes you back to http://mysite.com/ which immediately
creates http://mysite.com/#Home and you end up with the same history stack
again.

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


The thing is, the history calls the screen set-up routine with a token, the
menu system calls it, the onModuleLoad calls it with or without a bookmark.

The 'Home' token varies depending on what the menu items are called (this is
where the token comes from) so it can vary depending on the language, a
Spanish speaker might have 'Inicio' instead of 'Home'. It could be
'HomePage', and it might change if you log on as an admin, or a business, or
a customer, or whatever. I can't hard code it because it's a framework and
the menus and therefore the tokens, don't actually exist :-)

So what I really need is 'replace' and I've only just found out that GWT
can't do this consistently. So I'm stuck :-(

I've got to a point where the page with a blank token doesn't refire itself
into the home page, but I think that is the best I can do.

I don't too much since at least this time it's out of the control of the
Google team. </bitch>

Ian



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