progress bar in form in dialog?

I think this might’ve been dealt with before, but I can’t find it anywhere.

Is there a way to have a progress bar in a Form in Dialog, using the JProgressbar bean?

As apparently the Form in Dialog is modal, and waits for user interaction, I can’t quite think of a way for a method in a form to call a form in dialog with a progress bar, loop through a foundset of records doing stuff while the form in dialog is displayed, while updating the progress bar in the dialog, and then automatically closing the dialog when the loop is done.

Can anyone steer me in the right direction?

Eric Taub

There are 3 things I can think of:

  1. Create the form in dialog based on the same server/table and do your thing int he fid instead of your original form. This way you can update the progress bar.

  2. Download my splash plugin Servoy Components – Plugins, Beans, Web Components, Angular Services & Servoy Developer Consulting and place an animated gif in the spash (push sample code for different samples).

  3. Download the progress plugin Servoy Components – Plugins, Beans, Web Components, Angular Services & Servoy Developer Consulting and import the sample solution for samples. The progress plugins shows an animation in a milky white layer on top of the window. However, when your code is too intense it will not update very well (yet)…

Hope this helps,

Marcel

macwhiz:
I think this might’ve been dealt with before, but I can’t find it anywhere.

Is there a way to have a progress bar in a Form in Dialog, using the JProgressbar bean?

As apparently the Form in Dialog is modal, and waits for user interaction, I can’t quite think of a way for a method in a form to call a form in dialog with a progress bar, loop through a foundset of records doing stuff while the form in dialog is displayed, while updating the progress bar in the dialog, and then automatically closing the dialog when the loop is done.

Can anyone steer me in the right direction?

Eric Taub

Just use an onShow method: the FID opens the method starts doing stuff and the ProgressBar is updated as needed and when everything is done close the FID. One form + one method. Just remember to not allow the user to close the FID before the method ends.
Or maybe I’m not getting to the point?

Thanks very much.

How do I prevent a user from closing the form before it’s finished?

I can’t seem to figure it out.

Attach a method to the onclose event of the window where you return false if you want to prevent the window from closing. Just make sure it returns true under some conditions, otherwise you will be stuck!!!

Define a global called OK_to_close or something…

Thanks, everyone.

Yes, Swingman, I found out the hard way what happens if onclose always returns false!