On 30 mar, 23:04, Ian Bambury <[email protected]> wrote:
>
> 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'm not sure I follow you here, but IIUC then yes that's your best
option.

However, as I said: I'm really not sure I understood how your code is
articulated: where are you calling History.getToken()? where are you
calling History.newItem() ? where are you willing the Location.replace
() to take place?

Is your "best option" something like at the end of your "screen set-up
routine"?
if (History.getToken().length() > 0 && !tokens.home_token().equals
(tokenToSetUp)) {
   History.newItem(tokenToSetUp, false);
} // else: we're on the "blank" token and asked to display the home,
page, do nothing.

If yes, then I'd say it's OK, or you could refactor things to only
"react" to onHistoryChange and make your onModuleLoad call
History.fireCurrentHistoryState() and your menu system call
History.newItem() instead of calling the "screen set-up routine"
directly.

But a few lines of code showing how your "navigation" is articulated
would help...


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