I have created a plugin to notify a user that a solution is busy.
It does so by changing to the busy cursor, blocking user input, and darkening the screen (glass pane) with a message. The glass pane can be optionally turned off.
Sample:
//NOTE: BE SURE TO USE A TRY/FINALLY BLOCK! (or else an exception will cause the client to need a restart)
try{
plugins.busy.busy('Processing... please wait.'); // show the message on a glass pane and in the status area. Also, show a busy cursor
// or plugins.busy.busy('Processing... please wait.', false); // show the message in the status area (no glass pane). Also, show a busy cursor
// or plugins.busy.busy(null, true); // show a blank glass pane and status area. Also, show a busy cursor
// or plugins.busy.busy(); // just show a busy cursor
// do some process intensive work here
application.sleep(3000); //for example :)
}finally{
plugins.busy.ready();
}
New: Cancel support!
Cancel test code (note: the third arg enables the cancel button):
//NOTE: BE SURE TO USE A TRY/FINALLY BLOCK! (or else an exception will cause the client to need a restart)
try{
for(var i=0;i<20;i++)
{
plugins.busy.busy('Processing... please wait. ' + i,true,true);
application.sleep(500)
if(plugins.busy.isCanceled())
{
plugins.busy.busy('Canceling...');
application.sleep(400)
break;
}
}
}finally{
plugins.busy.ready();
}
Note: you can also use this as a progress indicator by calling the busy function multiple times to update the message.
The code has been tested on Mac OSX using Servoy 3.0
Should work on other platforms (in theory). Let me know if not :)[/b]
Currently the user cannot cancel out. It was designed to simply let the user know that the app is busy. I understand however, that it would be nice to have a way to cancel. The trick would be finding an easy (but elegant) way to notify the executing script that it has been canceled. I will check into adding this functionality but I cannot make any promises.
Trying to use the “busy” plugin in a FID. When the script is running within the FID the glass pane covers the underlying form but does not protect the FID. How do I get it to cover/protect the FID? K
In Client I get no error messge or something else. The methode (exporting over 10000 records to a .csv file) is working correct, the maus cursor is busy (rolling on mac) and the form is locked. I can live with this, but it would be nicer and more professional to get the dimmed screen.
In Client I get no error messge or something else. The methode (exporting over 10000 records to a .csv file) is working correct, the maus cursor is busy (rolling on mac) and the form is locked. I can live with this, but it would be nicer and more professional to get the dimmed screen.
Do you perform an application.updateUI() before you start your export?
I have tried to reach Paul by forum-message and mail but no response so far.
the busy plugin generates a nullpointer exception when you load/fire a webclient.
the busy plugin generates a nullpointer exception when you load/fire a webclient.
Is this when you use it in webclient or even when you don’t use it?
When you try to use it in webclient you will have no luck. The glass pane will not work in webclient.
The Progress Plug-in does not work in webclient either btw.