[Gambas-user] Progress of WebProgressBar
g4mba5 at gmail.com
Mon Jun 28 15:52:54 CEST 2021
Le 28/06/2021 à 15:36, Safiur Rahman a écrit :
> Hi Benoît
> When I use WebProgressBar for long process (eg. counting a result
> from database) then its value doesn't alter might be because the
> process gets busy.
> WebProgressBar1.Value = (res.Index + 1) / res.Count
> This shows me 0% then busy sign then 100%.
> How can I remove busy sign and update the value in WebProgressBar?
You must not forget that you are inside a request answer, so the
webbrowser is locked waiting for the request end.
You must split your long process so that it can be run using several
successive requests by using a WebTimer. Each step is processed during
the WebTimer 'Timer' event handler, and the Timer delay is adapted to
the duration of each step.
Another possible solution is running your job in an external process
whose state is read regularly by the main program. It's a bit tedious as
the main process is suspended between each request.
More information about the User