I’ve got a webapp, which sometimes depending on user-entries, has a lot of work to do.
I want to show a loading-indicator, to avoid that the users clicks several times on the button because nothing happens at first.
Because my app is very huge and has over 100 menus, I don’t want to add this functionality to every button and function by my self. Instead I search for a global solution.
So my question is:
Can I show a loading-indicator (intermediate progressbar, progress-wheel, etc.) to my webpage, if there is an operation in the app. I don’t want use threads
First of all, take a look at the AutoDisable property that we recently added to WebButton. That should help with your extra clicking problem.
As far as showing some sort of progress while an operation happens, you’re kinda stuck with threads or a timer. That’s the only way to push a command to a browser while something else happens in the background.
To make it more global, make a subclass of WebDialog with a progress bar and possibly a cancel button, and then create them in code:
[code]// Set up the dialog
ProgDlg = new MyProgressDialog
// now start the long running process
This assumes you also have a global property ProgDlg as MyProgressDialog. Heck, you could just wrap that into a pair of methods, one for showing and one for closing the dialog
Why not subclass the webbutton so it calls the modalDialog when clicked, add a new Action event definition so it works as usual, and make it super for all the buttons ? That will save a few lines of code for every button and possible errors.