Button click behavior with notification popup

In my vaadin 24 app I have a “long running” backend-task which creates a document and starts after creating the document the download.
When the user clicks the button, I want

  • to disable the button,
  • show a notification like ‘document creation started. Please stand by…’
  • and after the document was created and submitted to the browser I want to enable the button again.

I have tried a lot of things, but all I got, is that all things are done together. So the notification will be shown, when the document was created an downloaded. But this is to late for me.

I think it’s just a problem of the request / response behavior.
Is there a demo somewhere, for this scenario? I couldn’t find it.

1 Like

@Matti comes to rescue the day: flow-viritin/src/main/java/org/vaadin/firitin/components/DynamicFileDownloader.java at v24 · viritin/flow-viritin · GitHub

Keep in mind for the notification to show you would need push enabled

1 Like