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
Solved! Go to Solution.
navigateTo : function com_widget__navigateTo(urlToGo){
var aikauThis = this;
console.log(this);
setTimeout(function() {
aikauThis.alfServicePublish("ALF_NAVIGATE_TO_PAGE", {
url: urlToGo
});
},3000) ;
}
navigateTo : function com_widget__navigateTo(urlToGo){
var aikauThis = this;
console.log(this);
setTimeout(function() {
aikauThis.alfServicePublish("ALF_NAVIGATE_TO_PAGE", {
url: urlToGo
});
},3000) ;
}
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.