How to display a notification while changing slow tabs

Hi,

in my application I use a TabSheet with a few Tabs on it. The forms on this tabs are quite complex, so changing the tabs takes a while (the client browser needs time to process the JSON data).

What I want to to is showing a notification “Please wait while loading data…”. For this I added a SelectedTabChangeListener to my TabSheet and there added a notification to my main window.

The problem is, that my notification is shown only after the new tab is shown (so it’s useless). Is there any option to show the notification immediately after the user clicked on the new tab and so display it while the browser processes the JSON data?

I’m grateful for any ideas.

Greetings,
Jan

Take a look at the
Toolkit Productivity Tools
add-on. In addition to many other features, it has support for something like that.

Note that it has been developed against an older version of Vaadin, but it is pure server-side add-on, and probably almost if not completely compatible with current versions. You can post a message in the add-ons category of the forum or contact its author if there are any problems.

Hi,

thank you for this hint! I tried TPT but I can not find any way to solve my problem.

I looked at TPTLazyLoadingLayout… there’s a method lazyLoad()

It’s a very useful feature… but my problem is not the server but the client side of the implementation:

Currently the browser displays an empty tab for this ~5 seconds… and I’d like to display a message to the user during this time.

Also you could try
Lazy Load Wrapper
. With that you could have more places to tune the rendering and show a spinning wheel while rendering.

Lazy Load Wrapper could also actually resolve the actual issue - if you wrap different sections of the form with the wrapper, you can start rendering and loading them when they are actually scrolled to view (or a bit before that). If you can split the form to 10 parts, it could turn the load time from 5secs to 0.5 secs.

Try out
the demo
with a large “heavyness factor” to demonstrate this.

Thank you! The Lazy Load Wrapper looks great and I’ll give it a try.