Error while setting value of widget
Hi
I have a dialog with textfield. I placed a listener to display a custom widget which is a dialog itself which render along with first dialog. Below is my listener under textfield.
function(component){ var dialog = CQ.wcm.showTemplate('/content/geomatrixx/en'); dialog.show(); }I need when i click on the items(templates) that display inside second dialog, there path should populate in the textfield of first dialog. I have below code :
var dialog = CQ.WCM.getDialog(tempplateDialog); dialog.on("beforesubmit", function() { if(dataView.getSelectedRecords()[0] && dataView.getSelectedRecords()[0].data){ alert("path is :"+dataView.getSelectedRecords()[0].data.path +" "+CQ.Ext.get('mytemplate')); var tempPath = CQ.Ext.get('mytemplate').setValue(dataView.getSelectedRecords()[0].data.path); hiddenTemplate.setRawValue(dataView.getSelectedRecords()[0].data.path); }else{ CQ.Ext.Msg.alert(CQ.I18n.getMessage("You must select a valid template")); return false; } });Here when i try to apply setValue, it throw error Uncaught TypeError: undefined is not a function . But if i remove setValue the tempPath shows me [object Object].
Here mytemplate is the id of textfield.