Deferred/Async Container Population

Is there a recommended way to defer the population of a container during initialization?

If one is using a web service call to populate a container that blocks for a while, the UI becomes non-responsive. I should clarify that the components work properly so long as they don’t need to communicate with the server. The terminal appears to queue up requests that are then executed after the first call unblocks.

Is there a way to make things a bit more asynchronous?


Hi, here are some thoughts:

  • Do not try to initialize all data in the Application.init() function. That makes the application slow.
  • Try not to fetch any data in Component constructor either. Component objects are instantiated early (even component is not shown). Consider overriding the attach() function instead as it called when a component is shown.
  • If not using Google App Engine, you could use a server thread + ProgressIndicator to make a long process asynchronous.
  • Consider sharing data among application instances (i.e. among users/sessions). Statics are simple way of avoiding per user data initalization.