I can't make the busy plugin to work

Questions and answers on developing, deploying and using plugins and JavaBeans

I can't make the busy plugin to work

Postby juan.cristobo » Wed Jun 12, 2013 11:49 am

Hi all,

I want to use busy plugin in web client, but I can't :(

I have this method attached to a button:

Code: Select all
function __btnBusy()
{
   plugins.busy.prepare();
   
   var params = {
      processFunction: _pruebaBusy,
      processArgs: null,
      message: 'Please wait...',
      showCancelButton: true,
      cancelButtonText: 'Cancel'
   };
   plugins.busy.block(params);
}


The process function is only for test purposes:

Code: Select all
function _pruebaBusy()
{
   application.updateUI();
   
   try {
      for(var i = 1; i <= 1000; i++) {
         application.sleep(3000);
         if(plugins.busy.isCanceled()) {
            break;
         }
      }
   } catch (e) {
      application.output(e);
   } finally {
      plugins.busy.unblock();
      application.updateUI();
   }
}


When I click on the button, nothing happens (and no error message is sent to console). What's wrong?
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 186
Joined: Thu Apr 19, 2012 9:12 am

Re: I can't make the busy plugin to work

Postby ngervasi » Wed Jun 12, 2013 1:08 pm

I think the problem is the prepare function, it should be called in the form onShow event.
Have a look at the docs: https://www.servoyforge.net/projects/busy/wiki
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: I can't make the busy plugin to work

Postby juan.cristobo » Wed Jun 12, 2013 1:21 pm

Yeap, you're right!

I put prepare in onShow and it works.

Thanks!
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 186
Joined: Thu Apr 19, 2012 9:12 am


Return to Plugins and Beans

Who is online

Users browsing this forum: Bing [Bot] and 4 guests