Web ui progress bar

I wonder if and how to reach/control the general progress bar (from main window) in the web UI?

I would like to add a cancel button to the general progress bar to give the user the ability to stop running tasks, which components need to be customized.

Hi, @mike.bartsch

We have the ProgressBar component: docs.

But in your case I suggest that you take a look at BackgroundTasks: docs.

Regards,
Daniil.

Hello Daniil,

I was looking how to customize the logic/ behavior of Vaadin’s default loading indicator (which is a progress bar), however, the component is the last instance in a call chain. The task seems too big at the moment and resembles an open-hearted operation. I will try a different approach.

Is it possible to access all tasks triggered in the client (such as executing a DB query, manual execution of scheduled tasks etc), is there a central service/task watchdog?

Hi,

Unfortunately, there is no way to control default UI progress bar, it is a deep Vaadin implementation detail.

Moreover, if you cancel the client side request (for instance, just close browser tab) the request on the server side will not be canceled until finished. That’s why we recommend that you use BackgroundTasks mechanism if you start long-running tasks, they are processed in background threads that can be canceled from UI.

Hi @artamonov,

I have a table with custom columns - the information is fetched through Background Tasks (one for each cell).
I kept reference to the returned handler of BackgroundTaskHandler.handle(BackgroundTask) and executed the cancel() method of the handler but the BackgroundTask canceled() method, which I overridden, does not get called.

Could you please provide a short code sample of how you can cancel background tasks in such a case?

PS: Let’s say, when I press a button in the UI, all the ongoing background tasks must be canceled.
PSS: We use the latest version of CUBA6.

Hi,

Could you please provide a demo project or at least a code sample so that I will be able to investigate the correct case?

Regards,
Gleb