On 24 déc, 06:32, compuroad <[email protected]> wrote:
> I thought History.newItem() would only build the history stack.
> However in my App it fires the EntryPoint onModuleLoad, restarting the
> application.
>
> What am I missing?

Are you only experiencing this behavior in IE? or in other browsers
too?

There's a "workaround" for some weird behavior in IE that sometimes
reloads the app, and I suspect your call to
History.fireCurrentHistoryState() just after History.newItem(...) to
trigger it.

And actually, I don't understand those two lines: newItem() will fire
the event (unless you already are on the given token, obviously, as it
would then not result in a ValueChange), so why do you need
fireCurrentHistoryState? Can't you, either:
 - call newItem(page, false) to only fire the event from
fireCurrentHistoryState
 - or (I like this better and it is known to work): compare the
current token (History.getToken()) with the value you want to set and
choose whether to call newItem() or fireCurrentHistoryState based on
it?

Well, actually, having built an app this way, I now believe using
history change events as the navigation mean within the app isn't the
best approach. Our new app now fires internal events
(PlaceChangeEvent, to follow the "convention" settled by Ray Ryan's
talk at Google I/O 2009) which in the end cal newItem(..., false) to
"synch" the history token with the application's state (and when an
history state change event fires, due to an "external" action, we
synthesize a PlaceChangeEvent too, so the app can then "synch" with
the token; it'll result in a newItem(..., false) call in the end,
which will then be a no-op, and all is fine). My 2 c€nts.

--

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