この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
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?
解決済! 解決策の投稿を見る。
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
表示
返信
いいね!の合計
It should work. You might be calling before library is loaded. As Ove suspected you should see cq undefined etc.. error in javascript console.
表示
返信
いいね!の合計
Hi,
do you get any errors in the Javascript console? I tried the same thing and it works. At least in Chrome.
/O
表示
返信
いいね!の合計
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.
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
表示
返信
いいね!の合計