1

I am using WL.BusyIndicator with an adaptor call in Worklight 6.0:

this.busyIndicator.show();

WL.Client.invokeProcedure(invocationData, {
    onSuccess : function(response) {

        this.busyIndicator.hide();

        // do good stuff

}.bind(this),
    onFailure : function(err) {

        this.busyIndicator.hide();
        WL.SimpleDialog.show("Adapter Error", JSON.stringify(err), [{text: "OK"}]);

    }.bind(this)
});

This usually works, but on Android, when the adapter call fails (the worklight server is stopped) I will sometimes see the "Adapter Error" dialog, and when I dismiss it, the busyindicator is still there. At this point my app is dead, as there is nothing that I can do with the busyindicator running. (back button does not clear it)

There is nothing in the logcat other than the error message about the adapter call failing.

I've see this in the emulator on Android 4.1.2 and 4.2.2, and on a 4.1.2 phone. I wasn't able to reproduce it in the Android 2.2 emulator, but that runs so much more slowly, it may just be a timing window I can't hit there. I haven't seen the problem on iOS or in Chrome.

Has anyone else seen this?

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
David Dhuyveter
  • 1,416
  • 9
  • 17

3 Answers3

1

We have encounter similar problems in 5.0x version. We ended up creating a Busy Indicator manager and implemented a time out that would eventually close the indicator. We then directed all calls through this manager.

eborysko
  • 79
  • 3
0

I have something missing here...

Why are you using the BusyIndicator in the form of this.busyIndicator.show()?
Did you initialize your own busyIndicator? Try creating one of your own and then use it in the form of, for example: mybusy.show() and mybusy.hide().

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • This is just a fragment. this code is running in a class where I have a busyindicator that I initialize during class creation (which doesn't happen 'till wlCommonInit fires, so it is all good) 'this' always points to the class (notice that I bind 'this' for all callbacks) so this.busyIndicator is a valid reference to the busy indicator that I set up. This code works fine most of the time, and this.busyIndicator.show() never fails. It is only the call to this.busyindicator.hide() that intermittently fails silently on android. – David Dhuyveter Jun 27 '13 at 15:17
0

I have seen this issue with 6.0 and 6.1. I did initialize in wlCommonInit. Since we were using jquery I decide to switch to the jquery loader and seems to work as I expected the busyIndicator would work. Only issue is you do lose the native loading but this was something I had to get passed.

$.mobile.loading( "show", {text: "foo",textVisible: true,theme: "z",html: ""});
$.mobile.loading( "hide");
yoyo007
  • 9
  • 1