在 Worklight 6.1 中调用 busyInd.hide() 之前,忙碌指示器隐藏在 Android 中
Busy Indicator hides in Android before calling busyInd.hide() in Worklight 6.1
我正在使用 IBM Worklight Studio 6.1.0.02-20160314-1430
我正在使用多页和适配器。 onSuccess 函数我正在加载另一个页面。并在页面加载后在 onSuccess 函数中写入 busyInd.hide() 。问题忙指示器在页面加载前隐藏。从适配器获得响应后,下一页加载但同时忙指示器在加载下一页之前消失。它仅在 Android 的情况下发生,并且相同的代码在 IOS 和 WindowsPhone8 中工作正常。
this.form3Submit = function(){
var sessionid="userID";
busyInd.show();
var invocationData = {
adapter : "API_Adapter",
procedure : "SomeSubmit",
parameters : [sessionid],
compressResponse : true
};
WL.Client.invokeProcedure(invocationData, {
onSuccess : form3SubmitSuccess,
onFailure : AdapterFail,
timeout: timeout
});
};
form3SubmitSuccess = function(result){
invocationResult = result.invocationResult;
if(invocationResult.isSuccessful) {
$("#contentData").load("Views/form4.html", null, function (response, status, xhr) {
referenceno = invocationResult.something.Response.somerefno;
if(referenceno != ''){
//some lines of code
}
if(invocationResult.something.STATUS.CODE == '0'){
//some lines of code
busyInd.hide();
}else{
//some lines of code
busyInd.hide();
}
ko.applyBindings(self, $(".dynamic-page-content").get(0));
busyInd.hide();
});
}
busyInd.hide();
};
在 main.js 中声明忙指示符如下所示
var busyInd;
function wlCommonInit(){
busyInd = new WL.BusyIndicator('content', {text : 'Loading...'});
}
您正在将另一个页面加载到先前显示忙碌指示器的视口中,实际上您是通过完全替换 HTML 来移除忙碌指示器。这在意料之中。
如果你想让忙碌指示器在加载后仍然显示form4.html。您需要先将 HTML 页面加载到视口后再次显示它。
我正在使用 IBM Worklight Studio 6.1.0.02-20160314-1430
我正在使用多页和适配器。 onSuccess 函数我正在加载另一个页面。并在页面加载后在 onSuccess 函数中写入 busyInd.hide() 。问题忙指示器在页面加载前隐藏。从适配器获得响应后,下一页加载但同时忙指示器在加载下一页之前消失。它仅在 Android 的情况下发生,并且相同的代码在 IOS 和 WindowsPhone8 中工作正常。
this.form3Submit = function(){
var sessionid="userID";
busyInd.show();
var invocationData = {
adapter : "API_Adapter",
procedure : "SomeSubmit",
parameters : [sessionid],
compressResponse : true
};
WL.Client.invokeProcedure(invocationData, {
onSuccess : form3SubmitSuccess,
onFailure : AdapterFail,
timeout: timeout
});
};
form3SubmitSuccess = function(result){
invocationResult = result.invocationResult;
if(invocationResult.isSuccessful) {
$("#contentData").load("Views/form4.html", null, function (response, status, xhr) {
referenceno = invocationResult.something.Response.somerefno;
if(referenceno != ''){
//some lines of code
}
if(invocationResult.something.STATUS.CODE == '0'){
//some lines of code
busyInd.hide();
}else{
//some lines of code
busyInd.hide();
}
ko.applyBindings(self, $(".dynamic-page-content").get(0));
busyInd.hide();
});
}
busyInd.hide();
};
在 main.js 中声明忙指示符如下所示
var busyInd;
function wlCommonInit(){
busyInd = new WL.BusyIndicator('content', {text : 'Loading...'});
}
您正在将另一个页面加载到先前显示忙碌指示器的视口中,实际上您是通过完全替换 HTML 来移除忙碌指示器。这在意料之中。
如果你想让忙碌指示器在加载后仍然显示form4.html。您需要先将 HTML 页面加载到视口后再次显示它。