Long Operations, Progress?

Is there an easy way to have Servoy give some kind of indication that it’s working on something during long operations, like updating a large found set with on of the “do it all” commands.

It’s quite disconcerting for the screen to more or less freeze until things are done.

Regards,
Lee

Lee,

See post Wait cursor - Classic Servoy - Servoy Community

airmark:
Lee,

See post Wait cursor - Classic Servoy - Servoy Community

So, basically there’s no easy answer to this right now?

Thanks,
Lee

use application.updateUI() at specific places in youre code and youre screen will not freeze

jcompagner:
use application.updateUI() at specific places in youre code and youre screen will not freeze

Johan:

That’s hard to do with one line commands like the one that refreshes all calcs in the database. I guess we would have to divide the work into chunks and use this command in a loop?

Regards,
Lee Snover

are you constantly calling updates calcs in clients?
That shouldn’t really be needed. You really need to be very carefully what you do there!

But yes those things will be executed as a whole. So you can’t do much about those if you have a large foundset.

jcompagner:
are you constantly calling updates calcs in clients?
That shouldn’t really be needed. You really need to be very carefully what you do there!

But yes those things will be executed as a whole. So you can’t do much about those if you have a large foundset.

Johan:

I’m not constantly doing anything yet. ;-) But this is not something we would do frequently. There are other actions though that might take awhile, i.e. calling a stored proc. that takes a long time to run on the server. I just want a way of letting the user know that something is happening that may take awhille.

Thanks,
Lee Snover

those things is not possible yet.
Because then we must support ‘threading’ of scripts.

I must first look if this is possible and how to support it.

jcompagner:
those things is not possible yet.
Because then we must support ‘threading’ of scripts.

I must first look if this is possible and how to support it.

Johan:

What’s not possible yet? Calling Stored Procs? I hope that’s possible, as I have not yet tried. This should not involve multi-threading, though it would be nice so that the Client could continue with other tasks. I’m just talking about some visual indicator that a long process is running informing the user not to cancel, or otherwise disrupt the process.

Regards,
Lee Snover

Where are we talking about in this thread: Long operations and then still show progress.. This is only possible if the long operations is NOT runned in the foreground thread..

But this is only possible if:

1> the complete scripts runs in a background thread (blocking, but updating the ui)

2> the scripts runs in a foreground thread but the stored proc call is dispatched to a background thread. And when it is finished it calls a specified script to let you know it is finished…

The problem with <2> is that we don’t have options to block the ui yet.

jcompagner:
Where are we talking about in this thread: Long operations and then still show progress.. This is only possible if the long operations is NOT runned in the foreground thread..

But this is only possible if:

1> the complete scripts runs in a background thread (blocking, but updating the ui)

2> the scripts runs in a foreground thread but the stored proc call is dispatched to a background thread. And when it is finished it calls a specified script to let you know it is finished…

The problem with <2> is that we don’t have options to block the ui yet.

Johan:

Excuse the confusion on my part because I’m still quite new. What is a Foreground Thread and a Background thread? Are these available in Servoy presently? Or is this a coming feature? Number 2 would be a good option for a long stored proc. Number 1 would be ideal for shorter routines. Number 1 is more what I was aksing about in the original question.

Thanks,
Lee Snover

you have one foreground thread.
In this thread all ui things are handled and painted.
Also our scripts run in this thread currently. So if a script is running the ui can’t be painted and a user can’t do anything (selecting a button or …)

there are multiply background threads. We already use them for numerous things (like background relation loading etc). We could push more and more to them to do as little as possible on the foreground thread.

<1> is hard to do. Because of problems i won’t go into in this post..

<2> is possible in a more shortterm. But don’t know if this is really needed.. Or only for a few specific cases…

jcompagner:
you have one foreground thread.
In this thread all ui things are handled and painted.
Also our scripts run in this thread currently. So if a script is running the ui can’t be painted and a user can’t do anything (selecting a button or …)

there are multiply background threads. We already use them for numerous things (like background relation loading etc). We could push more and more to them to do as little as possible on the foreground thread.

<1> is hard to do. Because of problems i won’t go into in this post..

<2> is possible in a more shortterm. But don’t know if this is really needed.. Or only for a few specific cases…

Johan:

Well the fact that the threads are there is good news. Are these accessible to the developer? It would be for very long specific tasks, but definately could be useful.

1> Is what I’m driving at with my question though. I would simply like to be able to display a “working” message with some type of graphic indicator (beach ball, scrolling bar, etc.) to indicate that something is happening and the user needs to wait an indefinate time.

Thanks again!
Lee Snover

yes and for that you need to call updateUI or do it in a seperate thread so that the ui can update themself..

As i said as long as the scripts and what the are calling are running in the foreground thread then the ui can’t draw itself (except when you give it a bit of time when calling updateUI)

Hello Johan,

As far as I know it, cursors (and animated cursors) are using their own threads, this on all recent operating systems.

So please, let us change the cursor the same way we can change the status bar (having the ability to display a small rotating orange servoy logo would be a must). :D

application.setWaitCursor(true) and application.setWaitCursor(false)

I think this could almost satisfy any developer. Don’ you think so?

won’t work
If you set a cursor to something then the ui thread must be able to paint/change that
So setting in on a begin of script en resetting it on the end will not do one thing.

olivier melet:
Hello Johan,

As far as I know it, cursors (and animated cursors) are using their own threads, this on all recent operating systems.

So please, let us change the cursor the same way we can change the status bar (having the ability to display a small rotating orange servoy logo would be a must). :D

application.setWaitCursor(true) and application.setWaitCursor(false)

I think this could almost satisfy any developer. Don’ you think so?

I agree that would be helpfull, but I’d like to stick with more standard cursors if possible.

Regards,
Lee Snoveer