On 1 avr, 01:54, Ian Bambury <ianbamb...@gmail.com> wrote:
> 2009/3/31 Thomas Broyer <t.bro...@gmail.com>
>
>
>
> > Depends what "original token" is defined to be ;-)
> > if it is History.getToken(), then I'm back to my earlier proposal:
> > propagate a "is default" flag.
>
> I'm happy for you to define 'original token' if you can get it to work.
>
> But I don't need an isDefault flag - I already know that without it.

It would help if I knew how ;-)

But yes, thinking a bit more about it, isDefault wouldn't work. What
would work is a "history initiated" flag.

> How does it work with your definition of 'original token'?

I must have missed something in your app/framework behavior...

The problem is that History.getToken() can be where you come from
(when setMenuByToken is called by the menu) or where you're going to
(in response to history change), so you cannot use an if
(History.getToken().length()==0) to condition the call to
History.newItem(), or you'll never call newItem() (you pointed it
already: the onModuleLoad without hash/anchor propagates down, the
test evaluates to false and newItem isn't called, that's what we want,
but then clicking a menu propagates down to the page and the test
still evaluates to false).

Hence the introduction of the isHistoryInitiated flag.
1. onModuleLoad without hash/anchor: the page is shown with
isHistoryInitiated set to 'true', so in the end, History.newItem isn't
called, that's what we want (URL untouched, no history entry)
2. you click on the "panels" menu which calls setMenuByToken with
isHistoryInitiated==false, the #Panels~Summary page thus call
History.newItem
3. you navigate back to the home using your browser's back button:
onHistoryChange calls setMenuByToken with isHistoryInitiated==true,
the #Home page doesn't call newItem (it does not need to, as the
current history token already matches the displayed page)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to