When I drag and drop the component Click_Through_Link of group Call To Action on the page and refresh , I can see error in the console "Uncaught TypeError: Cannot read property 'getElementsByTagName' of null".
Why this is happening, please help .
Solved! Go to Solution.
Views
Replies
Total Likes
I got the problem. Its is happening because of the way divID is created in the OOB component.
See /libs/mcm/components/cta-clickthroughlink/cta-clickthroughlink.jsp #line 72
Id is encoded and used is html [divId = xssAPI.encodeForHTMLAttr(divId);]
And the same string divID is encoded in javascript (Written in /libs/mcm/components/cta-clickthroughlink/tracking-js.jsp #line21 ) to find the element which is wrong.
Solution :
Override the component and replace below code in cta-clickthroughlink.jsp #line 72
divId = xssAPI.encodeForHTMLAttr(divId);
%>
<div id="<%=divId%>">
With
String divHTMLId =xssAPI.encodeForHTMLAttr(divId);
%>
<div id="<%=divHTMLId %>">
Views
Replies
Total Likes
How are you setting the component in its dialog. Are you setting valid values:
Make sure that you enter a valid URL. See this AEM doc for more information:
Views
Replies
Total Likes
Thank you for your response.
I am facing the same problem attached is the screen for my dialog.
Views
Replies
Total Likes
@Aditi,
It seems there are some actions (On insert, edit
Check the listeners at the component level. Also, verify javascript in the component
Jitendra
Views
Replies
Total Likes
I got the problem. Its is happening because of the way divID is created in the OOB component.
See /libs/mcm/components/cta-clickthroughlink/cta-clickthroughlink.jsp #line 72
Id is encoded and used is html [divId = xssAPI.encodeForHTMLAttr(divId);]
And the same string divID is encoded in javascript (Written in /libs/mcm/components/cta-clickthroughlink/tracking-js.jsp #line21 ) to find the element which is wrong.
Solution :
Override the component and replace below code in cta-clickthroughlink.jsp #line 72
divId = xssAPI.encodeForHTMLAttr(divId);
%>
<div id="<%=divId%>">
With
String divHTMLId =xssAPI.encodeForHTMLAttr(divId);
%>
<div id="<%=divHTMLId %>">
Views
Replies
Total Likes