Skip to main content
October 16, 2015
Solved

CQ.WCM.isSidekickReady() not working

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

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: 

  1. function checkSidekickStatus() {
  2.     if (CQ.WCM.isSidekickReady()) {
  3.     console.log("I'm ready");
  4. clearTimeout(timeout);
  5.     }
  6. }
  7. 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

4 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

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: 

  1. function checkSidekickStatus() {
  2.     if (CQ.WCM.isSidekickReady()) {
  3.     console.log("I'm ready");
  4. clearTimeout(timeout);
  5.     }
  6. }
  7. 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

Translate
October 16, 2015

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.

Translate
Level 6
October 16, 2015

Hi,

do you get any errors in the Javascript console? I tried the same thing and it works. At least in Chrome.

/O

Translate
Sham_HC
Level 10
October 16, 2015

It should work. You might be calling before library is loaded. As Ove suspected you should see cq undefined etc.. error in javascript console.

Translate