IBM Worklight 6.0 - Unable to change the default WL.BusyIndicator text

青春壹個敷衍的年華 提交于 2019-12-12 10:24:02

问题


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:


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.



来源:https://stackoverflow.com/questions/18501456/ibm-worklight-6-0-unable-to-change-the-default-wl-busyindicator-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!