Default vaadin loading icon

Hi,

In my application, I am using thread to make heavy computation. So to make user waiting I am shown an icon loading (same as the default one). After that to show it on for example a table, the default loading icon appears, So I am facing with 2 simultnoeus loading icon.
So my question

  • Is it possible to enable/disable manually the default loading icon ??

Thanks

You could hide it with CSS, but other than that, no. What you can do is to move the operation to a background thread. That will free the vaadin thread to return immediately, so you won’t get a loading icon. when the thread is done, you can update the UI and pll for the changes (or push them).

I am already using a background thread. But pushing data to the UI take some time and in this case the default loading icon is appearing.

What I want is to show the default loading icon when the backgournd thread is running and so Ihe user is knowing that the task is running.

So my question is how to activate the loading icon when using background thread ??

Thanks for help

In this case you could use a Progress Indicator in Indeterminate mode as described
here in the Sampler
.

You can make it visible by changing the style of the element. Vaadin does it by setting the ‘display’ css on the v-loading-indicator div-element to ‘block’ instead of ‘none’ (which obviously hides it).

You will need to do one of 2 things; add CSS rules to your UI that controls this (make sure you use the !important keyword, otherwise the browser will disregard the rule since Vaadin specifies the rule inline in HTML which has higher priority). Or, you can write the javcascript (or GWT) code that changes the actual HTML directly. Option 1 is better, since with number two Vaadin may change the HTML back at any time.