I can't make the busy plugin to work

Hi all,

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

I have this method attached to a button:

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:

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?

I think the problem is the prepare function, it should be called in the form onShow event.
Have a look at the docs: About - Busy Plugin - ServoyForge

Yeap, you’re right!

I put prepare in onShow and it works.

Thanks!