03-30-2017 09:25 AM
Hello
I would like to have a sleep method in my aikau widget
navigateTo : function com_widget__navigateTo(urlToGo){
console.log(this);
setTimeout(function() {
this.myMethod();
console.log(this);
},1000) ;
}
********************************************
but it's not working, I have an error that say "this.myMethod doesn't exist"
It's not working only when I call my method inside the setTimeout function ... so as you can see I put two console.log(this) to see the problem, and they are not related to the same "this" wich I don't understand
the object is "this" in the widget and the window is "this" inside the method
03-31-2017 02:25 AM
navigateTo : function com_widget__navigateTo(urlToGo){
var aikauThis = this;
console.log(this);
setTimeout(function() {
aikauThis.alfServicePublish("ALF_NAVIGATE_TO_PAGE", {
url: urlToGo
});
},3000) ;
}
03-31-2017 02:25 AM
navigateTo : function com_widget__navigateTo(urlToGo){
var aikauThis = this;
console.log(this);
setTimeout(function() {
aikauThis.alfServicePublish("ALF_NAVIGATE_TO_PAGE", {
url: urlToGo
});
},3000) ;
}
Explore our Alfresco products with the links below. Use labels to filter content by product module.