Show/hide progressindicator

Hi, I would like to have an indetermined progress indicator when I click a button. This button does several things and then redirects to another page.

What I’ve done is to set the progressindicator next to the button and set the visibility to false. Then when the button is pressed the first thing I do is set the visibility to true, but the spin doesn’t show up until the clickevent is finished, so then the spin is pointless.

How could I make a spinning wheel appear
while
the button click event is doing its things?

Thanks

Hi,

you have to do your ‘several things’ in a separate thread. See the example in the book:
https://vaadin.com/book/-/page/components.progressindicator.html