Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
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?
RS
Last updated on
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.
Last updated on
You cannot reply to this thread.