This question is locked. New answers and comments are not allowed.
Hi All,
Have taken the AppBuilder demo and changed it around to access my own web services. The layout is the same, as I am only doing a tech check on what I can and cannot do. One part I am stuck on is that the showLoading doesn't trigger when it is called, but rather after my web service ajax call has run. To frame this, I use this to call my jscript function (same as the appbuilder example)
<span id="login" data-role="touch" data-bind="events: { tap: login }">
<a data-role="button" class="btn btn-login">Login</a>
</span>
The login function is this (cutdown):
app.mobileApp.showLoading();
MyWebservice.Field1 = myField1;
MyWebservice.Field2 = myField2;
MyWebservice.Connect();
if (MyWebservice.getStatus())
{
app.mobileApp.navigate("views/MyTest.html");
} else {
app.showAlert(strIncorrectLogin,"my App");
}
The delay can occur in the MyWebservice.Connect, which is what gets the data back from the WebService. But the showLoading does not appear, until the showAlert is used, then it sits behind the modal window. The MyWebservice is defined in a separate javascript file, which is (cutdown):
var MyWebservice= new function MyWebservice() {
var blnSuccess = false;
this.Field1= "blank";
this.Field2= "blank";
this.Connect = function (){
$.ajax({
url: constMyURL + "MyWebservice.asmx/MyFunction",
data: JSON.stringify({myFamily: { Field1: this.Field1, Field2: this.Field2}}),
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
async: false,
success: function (data) {
blnSuccess = data.d;
},
error: function (data) {
app.showAlert(strWebSerivceFailureMessage,"my Error");
blnSuccess = false;
}
});
};
this.getStatus = function (){
return blnSuccess;
};
};
Any idea's on how to trigger this during the ajax web service call, incase there is a delay? Also, is there a way to change the showLoading icon animation with something else? Have found how to change the text, but would like to replace the animated gif with something else.
Thanks.
Cam.
Have taken the AppBuilder demo and changed it around to access my own web services. The layout is the same, as I am only doing a tech check on what I can and cannot do. One part I am stuck on is that the showLoading doesn't trigger when it is called, but rather after my web service ajax call has run. To frame this, I use this to call my jscript function (same as the appbuilder example)
<span id="login" data-role="touch" data-bind="events: { tap: login }">
<a data-role="button" class="btn btn-login">Login</a>
</span>
The login function is this (cutdown):
app.mobileApp.showLoading();
MyWebservice.Field1 = myField1;
MyWebservice.Field2 = myField2;
MyWebservice.Connect();
if (MyWebservice.getStatus())
{
app.mobileApp.navigate("views/MyTest.html");
} else {
app.showAlert(strIncorrectLogin,"my App");
}
The delay can occur in the MyWebservice.Connect, which is what gets the data back from the WebService. But the showLoading does not appear, until the showAlert is used, then it sits behind the modal window. The MyWebservice is defined in a separate javascript file, which is (cutdown):
var MyWebservice= new function MyWebservice() {
var blnSuccess = false;
this.Field1= "blank";
this.Field2= "blank";
this.Connect = function (){
$.ajax({
url: constMyURL + "MyWebservice.asmx/MyFunction",
data: JSON.stringify({myFamily: { Field1: this.Field1, Field2: this.Field2}}),
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
async: false,
success: function (data) {
blnSuccess = data.d;
},
error: function (data) {
app.showAlert(strWebSerivceFailureMessage,"my Error");
blnSuccess = false;
}
});
};
this.getStatus = function (){
return blnSuccess;
};
};
Any idea's on how to trigger this during the ajax web service call, incase there is a delay? Also, is there a way to change the showLoading icon animation with something else? Have found how to change the text, but would like to replace the animated gif with something else.
Thanks.
Cam.