Can I create an animated progress bar while running a script on server with "Wait for completion" enabled? It doesn't need to actually track progress. It just needs show some sort of animation so that the user knows the database is working.
The only solution I know of is using gifs in a web viewer, but they don't see to animate while waiting for the script to complete. I know you can choose to not "Wait for completion" and instead prevent the user from doing stuff by putting them on a layout that doesn't have data entry fields, buttons, etc..., but I'd prefer to not do that.
I've seen a few implementations of progress bars, including with JavaScript,but they all rely on running that in a separate thread. You would have to periodically update the progress bar from FMS to display the current amount done.
Thanks everyone. These are all great methods that I've tried before. Unfortunately, I'm still on the same page as jwilling:
It always seems either frozen or glitchy.
Exactly. It's fine if I don't wait for completion and instead "poll for PSOS completion". In that case webviewer gifs animate fine.
Sometimes (especially in a multi-window environment), I just need to be sure the user isn't locking other records while the PSOS is doing its thing. Capturing errors is enough of a pain as is.
Attached is an example of a basic javascript slider to illustrate it animates independent of what's going on with a PSOS. Obviously you would find a more suitable control that loops (its entirely possible this one does but I didn't go into its documentation).
I don't know why I said "gif" earlier- I actually used someone else's javascript in a webviewer.
Your example file works great! Then I used my own progress bar which I had avoided using with PSOS/Wait in the past, and it also worked, so I'm a little confused. I know I had a reason for avoiding this, but I just can't remember what it was .
Anyways, thanks for this file, I'm going to work with this approach again soon.
It may have been the lack of a brief pause before loading the wv ? This was required in order to load the WV in time prior to executing the PSOS - otherwise it didn't work.
Another difference is explicit setting of the WV rather than setting the wv via calculation, that may have an impact.
Adhering to the KISS principal, I just open a floating windows with the word "LOADING....." centered in it, then select window back to the execution context for the PSoS kick off, and once it returned, close the loading window. No animation, but not brittle either. A floating window is always on top (coded to center on the parent window), and can be closed by the user if they so desire (never seen that actually happen - people wait for it to disappear on its' own).
a Base64 converted animated gif in a WebViewer works fine for me. Script starts with
set Var [$progressON; Value: 1]
ends with
set Var [$progressON; Value: 0]
Refresh
WV Object (ProgressBar) with 'HideObjectWhen = $progressON ≠ 1'