Difficulties with Web Modal Dialog, Progress Wheel, Thread use...

Hi! I’ve read many of the conversations about UI, Threads, Progress bars but, I still can’t figure out how to solve my problem… I guess I might be slow sometimes… :slight_smile: So if anyone would be kind enough to help me sort that out, it would be very appreciated…

Here’s what I am trying to do :

When the user saves his infos, the WEB App calls the initialisation of a class. The class constructor will perform several actions. These actions take 15 to 20 seconds to be realized. As you might imagine, I’d like to show a “Waiting modal” While the actions are performed.

I’ve made a couple of trials but I always run into the same problem : I can’t find a way show the modal during the execution of the actions. I can’t fiend a way to execute the actions triggered by my class instantiation from within the thread…


Hi Roger,
you can delegate to a webthread the processing requiring a long (and possibly indeterminate) execution time.

In your application define a modal webdialog (Apparence Type in the inspector) containing, for example, an indeterminate progress bar: this will be the processingdialog.

Create a subclass of a webthread: this will be your workerthread.
Add to the workerthread a public property of type webdialog: this will be the workingdialog.
Add to your workerthread any other useful property needed to do the long processing work.
In the run event of the workerthread add the code to be executed for the long processing task and as the last instruction:

When the user need to save the infos:

dim dlg as new processingdialog dlg.show dim wk as new workerthread wk.workingdialog = dlg

Now set to wk the values to the properties needed to do the long processing and start the processing:


Ask again if you need more help.


Show the modal dialog and THEN start the long process.

Thanks to both of you!

In fact, I tried both of these methods without success. I must be missing something… If I try to initiate my class whithin the thread, I get exceptions. If I try to open a dialog before I I initialize my Class, the dialog only shows after the class has been initialized and all the long routine has executed…

What am I doing wrong??? :slight_smile:

Thanks again! I finally found a way to do it. I used the shown Event Handler of my Modal Dialog to Initialize the Class :

sTemplateTables = New Template_Tables_Class Me.Close

I guess that’s what Michel meant by THEN… Thanks!