Busy indication using a free plugin!

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

Moderators: Jan Aleman, edward, bahamaen, mnorman, mattman

Busy indication using a free plugin!

Postby paul on Wed Oct 25, 2006 9:08 pm

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:
Code: Select all
//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):
Code: Select all

//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]
Attachments
busy.jar
Busy indicator plugin (with cancel support)
(7.74 KiB) Downloaded 372 times
cancel.jpg
Using the cancel option.
cancel.jpg (28.36 KiB) Viewed 3874 times
screenshot.jpg
screenshot.jpg (111.35 KiB) Viewed 3912 times
Last edited by paul on Thu Oct 26, 2006 4:17 pm, edited 1 time in total.
Paul
Information Technology
DNA Diagnostics Center
paul
 
Posts: 5
Joined: Tue Aug 29, 2006 3:51 pm
Location: Cincinnati, OH

Postby Harjo on Wed Oct 25, 2006 10:15 pm

works here on Windows XP! :D

Thanks for this great contribution!
Harjo Kompagnie
SAN Developer
Direct ICT - http://www.directict.nl / Servoy Hosting - http://www.servoyhosting.com / ServoyCamp - http://www.servoycamp.com
User avatar
Harjo
 
Posts: 3105
Joined: Fri Apr 25, 2003 10:42 pm
Location: DEN HAM OV, The Netherlands

Postby cybersack on Thu Oct 26, 2006 4:03 am

Ho does a user cancel out ?
User avatar
cybersack
 
Posts: 302
Joined: Sun Jan 02, 2005 12:17 am

Postby paul on Thu Oct 26, 2006 1:17 pm

cybersack wrote: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.
Paul
Information Technology
DNA Diagnostics Center
paul
 
Posts: 5
Joined: Tue Aug 29, 2006 3:51 pm
Location: Cincinnati, OH

Added cancel support

Postby paul on Thu Oct 26, 2006 4:18 pm

I have added cancel support! (see top post)

Hope this helps you out cybersack.
Paul
Information Technology
DNA Diagnostics Center
paul
 
Posts: 5
Joined: Tue Aug 29, 2006 3:51 pm
Location: Cincinnati, OH

Postby antonio on Sat Oct 28, 2006 10:26 pm

Great Plug, Paul! Thanks heaps for making it freely available.
Tony
Servoy Developer Version 5.1
Java version 1.5 & 1.6
Windows XP & MAC OSX
antonio
 
Posts: 461
Joined: Sun Apr 02, 2006 1:14 am
Location: Australia

Postby kurtbleicken on Fri Mar 14, 2008 8:35 pm

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
Kurt Bleicken
President, c3net, LLC
kbleicken@c3net.com
603.686.5574
kurtbleicken
 
Posts: 57
Joined: Mon Feb 12, 2007 10:36 pm

Postby tgs on Thu Apr 10, 2008 9:30 am

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
Thomas Schnaus
TGSproject
Business Solutions
User avatar
tgs
 
Posts: 398
Joined: Wed Oct 04, 2006 11:05 am
Location: Germany

Postby Harjo on Thu Apr 10, 2008 10:33 am

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

what does not work? do you get an error??
Harjo Kompagnie
SAN Developer
Direct ICT - http://www.directict.nl / Servoy Hosting - http://www.servoyhosting.com / ServoyCamp - http://www.servoycamp.com
User avatar
Harjo
 
Posts: 3105
Joined: Fri Apr 25, 2003 10:42 pm
Location: DEN HAM OV, The Netherlands

Postby tgs on Thu Apr 10, 2008 10:47 am

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
Thomas Schnaus
TGSproject
Business Solutions
User avatar
tgs
 
Posts: 398
Joined: Wed Oct 04, 2006 11:05 am
Location: Germany

Postby IT2Be on Thu Apr 10, 2008 10:54 am

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?
Marcel J.G. Trapman
IT2BE
SAN partner
http://www.servoycomponents.com (Servoy Plug-ins and Beans)
http://www.made-with-a-smile.com (iPhone, iPad and Mac Applications)
User avatar
IT2Be
Servoy Expert
 
Posts: 4620
Joined: Tue Oct 14, 2003 6:09 pm
Location: Germany

Postby Harjo on Thu Apr 10, 2008 11:00 am

or an application.sleep(500) just after the call.
Harjo Kompagnie
SAN Developer
Direct ICT - http://www.directict.nl / Servoy Hosting - http://www.servoyhosting.com / ServoyCamp - http://www.servoycamp.com
User avatar
Harjo
 
Posts: 3105
Joined: Fri Apr 25, 2003 10:42 pm
Location: DEN HAM OV, The Netherlands

Postby tgs on Thu Apr 10, 2008 11:49 am

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
Thomas Schnaus
TGSproject
Business Solutions
User avatar
tgs
 
Posts: 398
Joined: Wed Oct 04, 2006 11:05 am
Location: Germany

Re: Busy indication using a free plugin!

Postby markhooper on Thu Nov 27, 2008 12:02 am

Does this work for webclient ??

Thanks in advance
markhooper
 
Posts: 84
Joined: Fri May 30, 2008 6:28 pm
Location: Canada

Re: Busy indication using a free plugin!

Postby ars on Thu Nov 27, 2008 6:46 am

markhooper wrote: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...

BusyWindow.png
Preview of Busy Window
BusyWindow.png (60 KiB) Viewed 2921 times


Progress bar Image

ProgressBar.gif
Progress bar Image
ProgressBar.gif (10.57 KiB) Viewed 2944 times


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 http://forum.servoy.com/viewtopic.php?p=51630

Hope it Helps.
Arup Ranjan Sahoo
Find me @ arup.sahooATgmail.com
User avatar
ars
 
Posts: 211
Joined: Thu Jun 28, 2007 1:04 pm
Location: India

Next

Return to How To

Who is online

Users browsing this forum: No registered users and 0 guests