Here's a quick example of how to use a dialog listener in Adobe CQ to display the remaining characters in a textarea as a content author enters content.
- Start by locating the dialog node of your component and creating a new property with the name of characterCount.
- Set the value of the characterCount property to the contents the following gist:
- Once you've done this, create an nt:unstructured node called listeners beneath the node you want to affect.
- For each listener event type required, create a new property. In this case, I've created properties for the beforeloadcontent, loadcontent and keyup event listeners
- Set the value of each of these properties to the contents of the following gist: