Generic loading of component in separate thread


I was wondering if anyone implemented so far a generic way to load a component in a separate thread. For instance, we have tables displaying content with complex data aggregation. Loading the container may take some time (~5 seconds) and we don’t want to block the UI while the container is loading.

So one idea would be to display a loading indicator (a spin or something like that), load the container in a separate thread and when the container is initialized, replace the loading sign by the actual table.

Due to the Vaadin architecture and its component model, I think it would be quite easy to make that generic (and handle component sizing accordingly). Is there any add-on or something in core Vaadin that would do that?



add-on be enough for you ?

This addon has code for doing exactly what you want:

You could also code it your self.

thank you both!