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.
com.vaadin.flow.server.InvalidApplicationConfigurationException:
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
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
My spring boot main class have both @EnableAsync
& @Push annotations.
I even tried a Dialog with dialog.open()
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.
Update:
I further troubleshooted the issue and found that the execution is in below order:
restService.download() happens first
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 (restService.download()) & async is enabled in spring boot with @EnableAsync annotation.
Note:
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 = restService.download(...); 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