ProgressBar not appearing on button click

I have created a ProgressBar this way:

In the man layout →

ProgressBar progressBar = new ProgressBar();
Div progressBarLabel = new Div();
progressBarLabel.setText("Generating report...");

Within the button click listener →

someButton.addClickListener( event -> {

//do some tasks


But, the ProgressBar is not getting displayed on button click. What am I doing wrong here?

What happens during //do some tasks. Are you running some long-running task? If so, that’s blocking the response.

I covered how to handle long running tasks like this in a video a while back

yes, it takes about 2-3 seconds
But before that, I make the progressbar visible.
Thank you for the video, let me check it out…

The problem is that that entire code block runs synchronously during the same request.

So the progress bar gets set to visible and then invisible again during the same request. The client only gets the latest state, which is that the progress bar is invisible.

The video should do a better job of explaining it, hopefully :slightly_smiling_face:

got it
Let me try it out…
Thanks for the explanation :slightly_smiling_face:

I added @Push in MainLayout
But, I get an error:


Found app shell configuration annotations in non `AppShellConfigurator` classes.
Please create a custom class implementing `AppShellConfigurator` and move the following annotations to it:
    - @Push from com.keepvideo.application.views.MainLayout


Yeah, you’ll need to move the annotation in newer Vaadin versions

my spring boot main class implements AppShellConfigurator
So, can I move in there?

public class Application implements AppShellConfigurator {

    public static void main(String[] args) {, args);


Yes :+1:

I followed the video to make the necessary changes. But the progressbar is still not visible.
I could see the page is loading, but progressbar is not displayed :frowning_with_open_mouth:

My spring boot main class have both @EnableAsync
& @Push annotations.


vaadin version → 23.2.0

I even tried a Dialog with
that is not working inside a click listener as well
I tried all permutations and combinations for ProgressBar but no luck.
It’s bit weird that Vaadin new version is not giving the expected output for the working examples from an year back.
Let me know if I can send my code for your quick review.

I further troubleshooted the issue and found that the execution is in below order:

  1. happens first
  2. progressBar.setVisible(true) happens next
    3)progressBar.setVisible(false) happens next

Since (2) & (3) are happening adjacent, there’s no ProgressBar shown on the UI. This is happening even if I have an async method ( & async is enabled in spring boot with @EnableAsync annotation.

All the three steps mentioned above are happening within AddClickListener of button.

Hi @secure-leopard! In the meanwhile I’ve talked with @keen-quelea .
As far as I know and saw, the @Push and the @Async method with Thread.sleep was OK, but in his callchain (in the same method) there was a ListenableFuture<ResponseEntity<String>> downloadUrlResponseFuture =; downloadUrlResponseFuture.get().getBody();
where the get() method blocked the whole thread and was waiting for the ListenableFuture’s result. So this method wasn’t really async, and when it returned immediately called the result callback part where the progressBar visibility set back to false again (that’s mean the progressBar wasn’t visible almost never)…
Now it seems working…
Thanks for helping @secure-leopard