This gui component let you switch between a loading animation and the normal content
LoadingPanel is a UI component, that gives you the possibility, to switch between a loading animation and the normal content. The idea is that you can show a loading animation instead of the normal content content, while the data for the normal content is queried in the background (with a own thread). This gives you the possibility to implement some kind of async ajax behavioure.
LoadingPanel uses the great Refresher Add-on (https://vaadin.com/directory#addon/refresher) by Henrik Paul.
The way a LoadingPanel works is simple:
- create: LoadingPanel loadingPanel = new LoadingPanel();
- set the normal content: loadingPanel.setNormalContent(any UI Component you want);
- show the loading animation: loadingPanel.showLoading();
- show the normal content: loadingPanel.showContent();
Under the hood the Refresher Add-on is used to poll periodically the server for UI changes. But this is not done all the time. It starts to polling when you call loadingPanel.showLoadingPanel(); and will stop when loadingPanel.showContent(); is called.