aguerra10
18 Nov 2011, 12:28 PM
Hi all,
I am showing a confirm notification using PhoneGap with a callback function that uses some sencha basic code. However when this Sencha code runs, it is sending an error.
"Error in success callback: com.phonegap.notification0 = TypeError: 'undefined' is not a function"
This happens when "this.getMainView();" or any of the other lines inside logout method is called.
However, If I call the logout function without showing the notification, it works.
Can anybody help me?
Thanks!!
Here is the code involved :
init: function() {
this.setListeners();
},
setListeners:function(options) {
this.control({
'#settingsScreen button[id = logoutButton]': {
tap: this.showLogout,
},
});
},
showLogout: function() {
navigator.notification.confirm('Are you sure you want to logout?', this.onConfirm, 'Logout?', 'No,Yes');
},
logout: function() {
var mainView = this.getMainView();
var mainController = this.getController('MainController');
var launchscreen = this.getLaunchscreen();
mainController.setAnimationForward(mainView);
mainView.setActiveItem(launchscreen);
window.location.href = window.location.href;
},
onConfirm: function(buttonIndex) {
if (buttonIndex === 2) { this.logout();
}
},
I am showing a confirm notification using PhoneGap with a callback function that uses some sencha basic code. However when this Sencha code runs, it is sending an error.
"Error in success callback: com.phonegap.notification0 = TypeError: 'undefined' is not a function"
This happens when "this.getMainView();" or any of the other lines inside logout method is called.
However, If I call the logout function without showing the notification, it works.
Can anybody help me?
Thanks!!
Here is the code involved :
init: function() {
this.setListeners();
},
setListeners:function(options) {
this.control({
'#settingsScreen button[id = logoutButton]': {
tap: this.showLogout,
},
});
},
showLogout: function() {
navigator.notification.confirm('Are you sure you want to logout?', this.onConfirm, 'Logout?', 'No,Yes');
},
logout: function() {
var mainView = this.getMainView();
var mainController = this.getController('MainController');
var launchscreen = this.getLaunchscreen();
mainController.setAnimationForward(mainView);
mainView.setActiveItem(launchscreen);
window.location.href = window.location.href;
},
onConfirm: function(buttonIndex) {
if (buttonIndex === 2) { this.logout();
}
},