Busy plugin only works first time.

I’m having an issue with this whereby the plugin functions as it should the first time, but does nothing on subsequent calls. Tested on Chrome, Firefox and IE.

I have the parameters object defined like this (the plugin is set up in the form onShow() as per the instructions ) :

var statebusyParams = {
    processFunction: doJasperStatement,
    message: 'Please wait while your statement is created.', 
    opacity: 0.5,
    paneColor: '#000000',
    textColor: '#FF0000',
    showCancelButton: true,
    cancelButtonText: 'Cancel'
};

I then have a button onAction() event:

plugins.busy.block( statebusyParams );

The doJasperStatement() code that the plugin calls is as follows:

	var currentUser = globals.getCurrentUserInfo();
	var reportParams = {svyAccountCode : currentUser.accountCode};
	var ds = foundset.getDataSource();
	var d = ds.split('/');
	var myServer = d[1]; 
	plugins.jasperPluginRMI.runReport(myServer, 'statement.jasper', null, OUTPUT_FORMAT.VIEW, reportParams);
	plugins.busy.unblock();

The Servoy log has this at the bottom after the second call:

2012-02-27 16:23:30,015 TRACE [http-8080-5] com.servoy.j2db.util.Debug - JasperDebug: Parameter:  SUBREPORT_DIR (java.lang.String): C:/Users/abourke/servoy_workspace/ireport_compiled/
2012-02-27 16:23:30,099 TRACE [http-8080-5] com.servoy.j2db.util.Debug - JasperTrace: JasperReport finished
2012-02-27 16:23:30,099 INFO [http-8080-5] com.servoy.j2db.util.Debug - Busy ready called
2012-02-27 16:23:30,099 INFO [http-8080-5] com.servoy.j2db.util.Debug - Busy set to true

First you should always put your busy.unblock call in a finally block, like this:

function doJasperStatement() {
   try {
      var currentUser = globals.getCurrentUserInfo();
      var reportParams = {svyAccountCode : currentUser.accountCode};
      var ds = foundset.getDataSource();
      var d = ds.split('/');
      var myServer = d[1]; 
      plugins.jasperPluginRMI.runReport(myServer, 'statement.jasper', null, OUTPUT_FORMAT.VIEW, reportParams);
   } finally {
      plugins.busy.unblock();
   }
}

And then you don’t say what’s not working… is the blocking not happening, or is it not releasing at the end of your method.
Also you don’t say what version of Servoy you are using, and what are the conditions you have when you use the plugin: is this in developer, is that in a simple form, in a window, in a dialog (modal or modeless?), is the code located in a parent form, in a tab panel, etc…

The best thing would be to open an issue on ServoyForge issue tracker https://www.servoyforge.net/projects/busy/issues/new with a sample attached.

Hey patrick and alan ,

just for a heads up i faced the same issue today when i updated to busy plugin v2.2.1 , i am using servoy 5.2.12 and we are webclient solution , but i was testing it in developer .

As soon as i changed the plugin to busy v2.1.4 it worked fine . i am using busy plugin when user logs in for the first time and then for jasper reports . My code for jasper reports is the same as urs patrick .

I checked out server log and servoy log but there was no error log .

I will try to test more on it by next week and see if i can give u a better idea of what it is .

Did you use plugins.busy.prepare() in your onShow handler?
This is useful in web client to put the necessary scripts in the header of the page.

Patrick

This is Servoy Developer 6.0.5 and the current version of the plugin. It’s a simple, flat web client page with a tabpanel on it, the button that runs this is on the page itself, not the tabpanel.

I have issued the prepare() code in the onShow()

What happens the second time through is that it hits the call to block() and nothing happens. Servoy log output is as detailed above. The application continues to function as normal.

I 'll try the try/catch approach you mentioned.

Wrapping it in a Try didn’t work either … will deploy it and if it works in that mode I can live with that !

BTW, thanks you to Patrick for this and all the other top notch work he has donated for free - I hope I don’t come across as ungrateful or complaining in this!

No worries Alan, I just pointed you to the ServoyForge issue tracker because it’s there for a reason: first I receive a notification right in my mail box and into my Eclipse IDE thanks to Mylyn, when it’s not guaranteed that I will see you post on the forum, then I can track it and have that in my TODO list, and moreover, it forces you to put some information like Servoy version etc… which helps to try and reproduce an issue.

I’ll have a look asap, but my guess is that something changed in the latest Wicket jar used by Servoy that broke the plugin because we have an issue very similar to this in the WebClientUtils as well suddenly…

+1 on this. The block method gets executed, but the function to be called is not.

Servoy 6.0.5
XP SP3
Java 7