Hi Brian,
Glad to hear that you've solved the problem.

The difference in behaviour between hosted mode and web mode could be due to
which platform you're running on, and which browser you used to test in web
mode. If you're on Windows, for example, then the hosted mode browser would
be an embedded instance of IE. It could be that the reloading behaviour is
something specific to IE, whereas on the browser you web mode tested on,
this might not have been an issue (FF or Chrome). The application not
changing is probably a result of checks performed during the GWT bootstrap
process (I think). It isn't common to want to refire an onModuleLoad()
programmatically without explicitly refreshing or reloading the page.

Hope that helps,
-Sumit Chandel

On Thu, Mar 5, 2009 at 7:59 AM, Brian Ferris <[email protected]> wrote:

>
> Ok so I finally tracked this down.  A TextBox and Button wrapped in a
> FormPanel was the culprit.
>
> I had wrapped a TextBox and Button with a FormPanel in my application
> so that browser autocomplete mechanisms would automatically save
> repeated form values for users of my app.  What I didn't realize is
> that even though I had a custom KeyboardListener on the TextBox and a
> ClickListener on the Button that performed some operations on the
> page, a carriage return in the TextBox or a click of the Button
> automatically resulted in a form submission.  Since I had never set
> the form action, it defaulted to the app's url and ended up in app
> reload and my modules reloading.  Adding a FormHandler that canceled
> the submission fixed the problem.
>
> What is perplexing on this issue was that it only seemed to happen in
> hosted mode.  I had debugging statements in my key module entry points
> and they were only refired in hosted mode and not compiled web mode.
> What's more, even though my module entry points were all refiring and
> should have theoretically been reconstructing my entire app from
> scratch, there didn't seem to be any noticeable effect on the app
> itself.  Maybe the reconstructed app was getting shunted off to some
> other hidden DOM element since the main app was already resident?  I
> don't know.
>
> Thanks,
> Brian
>
> On Mar 5, 5:53 am, Isaac Truett <[email protected]> wrote:
> > Since it's in hosted mode, you can set a breakpoint in onModuleLoad()
> > and look at the stack to determine where it's being called the 2nd and
> > subsequent times.
> >
> > On Thu, Mar 5, 2009 at 3:55 AM, Sumit Chandel <[email protected]>
> wrote:
> > > Hi Brian,
> > > This definitely shouldn't be standard behaviour, and would be something
> to
> > > worry about if it's occurring due to a bug in hosted mode, however
> that's
> > > unlikely.
> > > The more likely cause is either what Jason mentioned above - you have
> > > multiple entry points defined either in your first module or in modules
> > > you're inheriting from - or that the code updating the UI when your RPC
> > > comes back is somehow reloading or refiring the onModuleLoad() method.
> I'm
> > > not sure what that something could be if it's only causing
> theentrypointto
> > > run multiple times in hosted mode and not in web mode, but the next
> step
> > > would probably be to post up that code to see if there's anything to
> > > investigate there.
> > > Hope that helps,
> > > -Sumit Chandel
> >
> > > On Wed, Mar 4, 2009 at 3:50 PM, Jason Essington <
> [email protected]>
> > > wrote:
> >
> > >> remember, if your libraries (other GWT modules) also have entry
> > >> points, all of the onModuleLoad() methods will be called in turn.
> >
> > >> -jason
> >
> > >> On Mar 4, 2009, at 12:30 AM, Brian Ferris wrote:
> >
> > >> > I have a relatively complex GWT application composed of my main
> > >> > applicationEntryPointand a number of library modules.  I had some
> > >> > printlns in theEntryPointfor my application and the libraries and I
> > >> > noticed that they are called multiple times over the course of the
> > >> > application lifetime in hosted mode.  This is not the standard "I
> just
> > >> > hit the reload button" case where you expect to hit your module
> > >> >EntryPoint, but more of the case where a user has just hit a button
> to
> > >> > initiate an RPC call that then updates the UI.
> >
> > >> > Is this expected behavior?  Something I should be worried about?  I
> > >> > apologize for not posting any code samples, but I'm hoping there is
> > >> > something simple I'm missing before I go through the work of trying
> to
> > >> > reproduce the behavior with a simpler code fragment.
> >
>

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