Page 1 of 1

I can't make the busy plugin to work

PostPosted: Wed Jun 12, 2013 11:49 am
by juan.cristobo
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?

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

PostPosted: Wed Jun 12, 2013 1:08 pm
by ngervasi
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

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

PostPosted: Wed Jun 12, 2013 1:21 pm
by juan.cristobo
Yeap, you're right!

I put prepare in onShow and it works.

Thanks!