Listeners are not working in AEM6 Touch UI
Hi,
I have a requirement that I need to set some text to textfield when checkbox is checked. I wrote a listener for this. It is working fine in Classic UI.
But it is not working in Touch UI. My dialog.xml is like below -
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root 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="cq:Panel"
title="Article">
<items jcr:primaryType="cq:WidgetCollection">
<article
jcr:primaryType="cq:Widget"
collapsed="{Boolean}true"
collapsible="{Boolean}true"
title="Article Content"
xtype="dialogfieldset">
<items jcr:primaryType="cq:WidgetCollection">
<modifiedDateFlag
jcr:primaryType="cq:Widget"
fieldDescription="Enable to display the modified date on front end"
fieldLabel="Modified Date"
name="./modifiedDateFrontEndFlag"
type="checkbox"
xtype="selection">
<listeners
jcr:primaryType="nt:unstructured"
selectionchanged="function(comp){var dlg=comp.findParentByType("dialog");var textfield=dlg.getField("./pageModifiedDate");textfield.setReadOnly(true);if(this.getValue()=="true"){var today=new Date();var dd=today.getDate();var mm=today.getMonth()+1;var hrs=today.getHours();var mins=today.getMinutes();var sec=today.getSeconds();var yyyy=today.getFullYear();if(dd<10){dd="0"+dd;}if(mm<10){mm="0"+mm;}var today1=mm+"/"+dd+"/"+yyyy+" "+hrs+":"+mins+":"+sec;textfield.setValue(today1);}}"/>
</modifiedDateFlag>
<modifiedDate
jcr:primaryType="cq:Widget"
fieldDescription="Modified Date of Article"
fieldLabel="Modified Date"
name="./pageModifiedDate"
xtype="textfield"/>
</items>
</article>
</items>
</jcr:root>
Please let me know the solution ASAP.
Thanks,
Arya.