Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

onChange for RichText

Avatar

Level 1

How to do the onchange for the richtext?

I did it like this but i doesn't work

<someField
   jcr:primaryType="cq:Widget"
   allowBlank="true"
   name="./someField"
   xtype="richtext">
  <rtePlugins
   jcr:primaryType="nt:unstructured">
  <subsuperscript
   jcr:primaryType="nt:unstructured"
   features="[subscript,superscript]"/>
  </rtePlugins>
  <listeners
   jcr:primaryType="nt:unstructured"
   change="function() {console.log('success')}"
   />
</someField>

6 Replies

Avatar

Level 6

Hi AndreiUifi May i know which AEM version are you using ?

Avatar

Level 10

You are using Classic API and not TOuch UI.

For Touch UI - you can use the DOM to handle events - see

Adobe Experience Manager Help | Using Event Handlers in Adobe Experience Manager Touch UI Components

For Classic UI - there is a rich set of Event Handlers for RichText - see this ref doc:

CQ5 | Widgets API

ARichText.png

Avatar

Level 1

On Classic UI for richtext, 'change' doesn't work

Avatar

Level 6

In classic UI  change  exits. pls use correct method paramentes to work.

change : ( CQ.Ext.form.Field this, Mixed newValue, Mixed oldValue )

Fires just before the field blurs if the field value has changed.Listeners will be called with the following arguments:
  • this : CQ.Ext.form.Field
  • newValue : MixedThe new value
  • oldValue : MixedThe original value

1343294_pastedImage_1.png

CQ5 | Widgets API