Now, there is quite some data to load as I have to do a list, then a get for each item. I was wondering about showing a progress bar…
The obvious answer would be to just start the background task in the data loader load delegate, but that would block the UI as I have to return the list from there.
How would one, appropiately, defer the data loading to a background task?
Alternatively… how can I give CUBA hints on the nice progress bar it already shows in the top of the window?
If you want to load data asynchronously, you cannot use declarative data loaders. Instead, use a background task and set the result to data containers programmatically.
An example based on the github-statistics project:
Of course, instead of BackgroundWorkWindow with indefinite progress bar you can use BackgroundWorkProgressWindow or BackgroundWorker with a custom progress bar.