I had a working version of my app using V2 GWTP. After porting to V3
(current hg head) I observe a really strange behaviour.
I kept debugging, but I am a bit lost at that point now.
On the initial load of my app everything is fine. My App (a bit like
nestedexample) is set up, all presenters and views initialized. Gin
works, default place works. Cool.
However, when I navigate around, or call a certain place manually in
the browser URL the respective place is revealed four times
subsequently. When I debug I can clearly see that protected void
revealInParent() {..} is called exactly four times. This happens for
all my presenters right now.
It might be the case that something fundamentally went wrong when
eliminating my TokenFormatter calls and such, but the error even
happens, when I type my #Place manually in the browser what is imho
strange.
Any ideas why this "four-time-calling-of-presenters" might happen?
Sorry for the fuzzy description, but maybe anybody knows that behaviour.
Thanks!
Raphael
I found the error. In V2 it is okay to bind everything as
inSingleton() scope. In V3 it seems I have to bind my basic stuff
asEagerSingleton().
bind(EventBus.class).to(DefaultEventBus.class).asEagerSingleton();
bind(PlaceManager.class).to(AppPlaceManager.class).asEagerSingleton();
bind(TokenFormatter.class).to(ParameterTokenFormatter.class).asEagerSingleton();
bind(RootPresenter.class).asEagerSingleton();
bind(ProxyFailureHandler.class).to(DefaultProxyFailureHandler.class).asEagerSingleton();
Maybe I missed that in the docs - if not this might be something for
the porting to V1 guide.
Cheers,
Raphael
I think you need the RootPresenter, and maybe the PlaceManager to be
eager singletons, but I wouldn't think the other are required.
Anyway, thanks for sharing. I will investigate this if I ever have the
time and am able to reproduce it.
PHilippe
On Thu, Jun 17, 2010 at 1:11 PM, Raphael André Bauer
okay. I am still using r137. So - that means that you two do not have
to bind your singletons "asEager"? Only me? Seems strange to me. So it
might be really a bug of GIN and has nothing to do with GTWP.
Thanks for your answers and clues,
If there is a anything I can do to to debug please help let me know...
Raphael
Yea! That works for me, too....
=> imho this "issue" arises when you update to V0.3 (current head)...
I think it would be great if you could mention that briefly in:
http://code.google.com/p/gwt-platform/wiki/PortingV1
(if you want, I can write three lines + a code snipplet..)
Thanks again!
Raphael
If I recall corectly, there's a bug in Gin where configure is called twice... maybe that have something to do with it.
Raphael