IBM Worklight 6.0 - Unable to change the default W

2019-06-14 07:34发布

I've test WL.BusyIndicator like following code:

    busyIndicator = new WL.BusyIndicator('content', {
    text : 'saving'
});
busyIndicator.show();
setTimeout(function() {
    busyIndicator.hide();
}, 3000);

The Information Center says BusyIndicator options can get 'text' in Android environment.

I can see the BusyIndicator shown on my Android Emulator (v4.0.4/v4.1.2/v4.2.2) but the text is default 'Loading'...

Note: the same happens in iOS as well.

My Worklight Studio version is: 6.0.0.201307241843

1条回答
我想做一个坏孩纸
2楼-- · 2019-06-14 08:24

Try the following code:

function wlCommonInit(){

    WL.ClientMessages.loading = "Hello world :)";

    var busyInd = new WL.BusyIndicator('content'); 
    busyInd.show();

    setTimeout(function () {
        busyInd.hide();
    }, 3000);
}

Notice that I'm using WL.ClientMessages.loading to set the message, instead of passing an object with the text key to the constructor.

I had to look at the Busy Indicator code to figure out what was wrong, I'll open a defect. Thanks for reporting this.

查看更多
登录 后发表回答