Busy indication using a free plugin!

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]

busy.jar (7.74 KB)

works here on Windows XP! :D

Thanks for this great contribution!

Ho does a user cancel out ?

cybersack:
Ho does a user cancel out ?

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.

I have added cancel support! (see top post)

Hope this helps you out cybersack.

Great Plug, Paul! Thanks heaps for making it freely available.

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

Hello Paul,

your ‘busy’ plugin is a cool thing, but for me it only works in Servoy developer and not on the Client! What is wrong?

Regards, Thomas

hmm, that is strange, we use it almost a year now, in developer AND client.

what does not work? do you get an error??

Hi Harjo!

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.

Regards, Thomas

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?

or an application.sleep(500) just after the call.

Thank you guys!

I modified my methodes by performing ‘application.updateUI()’ and now it works!

Regards an thank you again for your fast reply, Thomas

Does this work for webclient ??

Thanks in advance

markhooper:
Does this work for webclient ??

Hope not.

However, one of the workaround will be showing a modal window with some progress bar(image) would be nice…

See for a preview, did right now…

[attachment=1]BusyWindow.png[/attachment]

Progress bar Image

[attachment=0]ProgressBar.gif[/attachment]

If you would like to non-functional the close button, then you can also do the same by just returning false with the onHide event of the form. See this topic Prevent a dialogue box from closing - #4 by sanneke - Classic Servoy - Servoy Community

Hope it Helps.

ProgressBar.gif

Hi Paul,

Great plugin !!

I was wondering if it is possible to add one option :

Show busy cursor and a dialog form with text instead of a glass pane over the whole form.

Regards,

Hans

Have you taken a look at our Progress Plug-in?

It does what you want I think and, although not free, modestly priced!

http://www.it2be.com/index.php/plugins- … ss-plug-in

Hi Hans,

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.

I thinks it’s better to look for alternatives…

Hi Marcel,

We already purchased the progress plugin.

BUT : i need a very simple/basic feedback to the user.

  1. only dialog box with text
  2. no progress indicator (needs updateUI’s which i do not want to use here)
  3. must close automatically at the end of the method. User does not have to click cancel.
  4. no cancel option

Regards,

Hans Nieuwenhuis

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.