Skip to main content
November 2, 2021

Rich text editor is throwing error in AEM 6.4 when you make it part of any component

Hi,

 

RTE in AEM 6.4 is throwing an error when I make the component configurable by adding a checkbox for users in the dialog for authors to use the RTE in any custom component. However, after I select the checkbox and add content to it and click on 'ok' checkmark, it throws an error initially but if I refresh the page, the component is throwing content in RTE correctly. If I again update the content in the same page and click on 'ok' checkmark, it's throwing the error again until I refresh the page.

Error message - Uncaught (in promise) TypeError: Cannot read properties of null (reading 'data')  - http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.894e3547679632b5f44a9833bcb0529b.js

The code for adding RTE in the component looks like this: <div data-category="${properties.tiletype}" data-sly-test="${properties.includedes}" data-sly-resource="${'something' @ resourceType='/apps/foldername/components/content/genericrichtext'}"></div>

If I use the RTE component all by itself and not as part of a different component then it's working fine. 

What could be causing this issue? 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

BrianKasingli
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
November 3, 2021

Can you share the TouchUI Dialogue .content.xml please; 

Translate
November 3, 2021

Hi Brian,

 

The .content.xml for this is pretty straightforward:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
jcr:title="Hero Component"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/tabs"
type="nav"/>
<items jcr:primaryType="nt:unstructured">
<general
jcr:primaryType="nt:unstructured"
jcr:title="general"
sling:resourceType="granite/ui/components/foundation/section">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
margin="{Boolean}false"/>
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<image
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/fileupload"
allowUpload="{Boolean}false"
autoStart="{Boolean}false"
class="cq-droptarget"
fieldLabel="Desktop Image"
fileNameParameter="./imgdesktopfile"
fileReferenceParameter="./imgherolist"
mimeTypes="[image]"
multiple="{Boolean}false"
name="./imgdesktopname"
title="Upload Image Asset"
uploadUrl="${suffix.path}"
useHTML5="{Boolean}true"/>
<imgalttext
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="Image Alt Text"
name="./imgalttext"/>
<imagepath
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/pathbrowser"
fieldLabel="Image Link"
name="./imglink"
rootPath="/content/"/>
<checkbox
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/checkbox"
name="./includedes"
text="Include RTE for Description"
type="checkbox"
value="{Boolean}true"/>
</items>
</column>
</items>
</general>
</items>
</content>
</jcr:root>

Translate