Follow the below steps to create or attach listeners (javascript event listeners) to any widget in CQ5 / AEM.
- Create a node by name "listeners" of type "nt:unstructured"
- Find out the events which can be attached to a widget. You can find the list of events from the CQ Widget API documentation. Click here to visit.
- e.g. The "pathfield" widget has got one event called "dialogclose". This event is fired when user selects any link from the browse field & clicks OK.
- To attach this add one property by name "dialogclose" to the listeners node. The value should be any javascript function call.
- e.g. function(){ console.log("You have selected a link in path field"); }
- Please see below image for reference.
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging.
ReplyDeleteDevops Training courses
Devops Training in Bangalore
Best Devops Training in pune
Microsoft azure training in Bangalore
Power bi training in Chennai
I just recently discovered your blog and have now scrolled through the entire thing several times. I am very impressed and inspired by your skill and creativity, and your "style" is very much in line with mine. I hope you keep blogging and sharing your design idea
ReplyDeletedata science training in chennai
data science training in velachery
android training in chennai
android training in velachery
devops training in chennai
devops training in velachery
artificial intelligence training in chennai
artificial intelligence training in velachery