Clarification to use progressBar

Hello everyone, I am trying to do something simple, I want the user to press a button to show a progress bar, the screen is blocked and when this process is finished remove the progress bar. At first I do not want to create a background task, nor do I want to update the progress bar. In studio I’m placing the progress bar on the screen and marking the visible check as false, then from java I try to make a: progresbar.setVisible (true) when I start the process and progressbar.setValue (false) when finished but not showing me the progress bar. What am I doing wrong? I should put progressbar in some component to show it dialog type or I can put it anywhere on the screen ?.
Thanks and regards.

Hi,

All requests from a browser to CUBA server are blocking, so you cannot show ProgressBar before a heavy operation and update it during this operation in a request handling thread.

If you want to perform a heavy operation and show a progress then you can use BackgroundTask functionality from CUBA, it is described here: https://doc.cuba-platform.com/manual-6.3/background_tasks.html Also there are useful classes BackgroundWorkWindow and BackgroundWorkProgressWindow that can be used with a BackgroundTask to show progress.

See also the sample on BackgroundTask with progress window here: https://www.cuba-platform.com/discuss/t/hourglass-component#comment-1161 and progress bar demo in our Sampler: https://demo.cuba-platform.com/sampler/open?screen=normal-progressbar