I am trying to add some custom handling to the Sidekick and I am following this example: http://adobecms.blogspot.ca/2014/04/sidekick-customization.html
I've included this code in my component.jsp:
<script> function checkSidekickStatus() { if (CQ.WCM.isSidekickReady()) { // do stuff clearTimeout(timeout); } } var timeout = setInterval(checkSidekickStatus, 1000); </script>
But, it never gets past the "CQ.WCM.isSidekickReady()" check, even though the Sidekick is clearly ready. Any suggestions?
Solved! Go to Solution.
Views
Replies
Total Likes
albinomouse wrote...
Where should I place my code to ensure that it is called at the correct time?
When I do the simple example I posted above, I do not get an error message in the console:
function checkSidekickStatus() {
if (CQ.WCM.isSidekickReady()) {
console.log("I'm ready");
clearTimeout(timeout);
}
}
var timeout = setInterval(checkSidekickStatus, 1000);
But I don't get my console log message either. If it is in the jsp, shouldn't it run when I add my component to the page?
What I would like, in the end, is to have an EditConfig listener on "afterinsert" which calls a method to disable some buttons on the Sidekick after inserting this component to a page.
For your usecase follow http://experience-aem.blogspot.com/2013/08/get-sidekick-instance-and-disable.html
Views
Replies
Total Likes
It should work. You might be calling before library is loaded. As Ove suspected you should see cq undefined etc.. error in javascript console.
Views
Replies
Total Likes
Hi,
do you get any errors in the Javascript console? I tried the same thing and it works. At least in Chrome.
/O
Views
Replies
Total Likes
Where should I place my code to ensure that it is called at the correct time?
When I do the simple example I posted above, I do not get an error message in the console:
function checkSidekickStatus() { if (CQ.WCM.isSidekickReady()) { console.log("I'm ready"); clearTimeout(timeout); } } var timeout = setInterval(checkSidekickStatus, 1000);
But I don't get my console log message either. If it is in the jsp, shouldn't it run when I add my component to the page?
What I would like, in the end, is to have an EditConfig listener on "afterinsert" which calls a method to disable some buttons on the Sidekick after inserting this component to a page.
Views
Replies
Total Likes
albinomouse wrote...
Where should I place my code to ensure that it is called at the correct time?
When I do the simple example I posted above, I do not get an error message in the console:
function checkSidekickStatus() {
if (CQ.WCM.isSidekickReady()) {
console.log("I'm ready");
clearTimeout(timeout);
}
}
var timeout = setInterval(checkSidekickStatus, 1000);
But I don't get my console log message either. If it is in the jsp, shouldn't it run when I add my component to the page?
What I would like, in the end, is to have an EditConfig listener on "afterinsert" which calls a method to disable some buttons on the Sidekick after inserting this component to a page.
For your usecase follow http://experience-aem.blogspot.com/2013/08/get-sidekick-instance-and-disable.html
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies