Expand my Community achievements bar.

SOLVED

Error while setting value of widget

Avatar

Level 5

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.

1 Accepted Solution

Avatar

Correct answer by
Level 10

custom implementation, without providing clear description on use case & implementation details not sure how to assist here.  You can look into various oob implementation like path predicate, tag input matches almost what you are doing.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

custom implementation, without providing clear description on use case & implementation details not sure how to assist here.  You can look into various oob implementation like path predicate, tag input matches almost what you are doing.

Avatar

Level 5

Sham HC wrote...

custom implementation, without providing clear description on use case & implementation details not sure how to assist here.  You can look into various oob implementation like path predicate, tag input matches almost what you are doing.

 

Hi Sham

Its worked, Do you have any idea how to get the payload in dialog participant step as in my dialog file there is listener, inside it i need the payload.

Thanks

Avatar

Level 10

vdhim23 wrote...

Sham HC wrote...

custom implementation, without providing clear description on use case & implementation details not sure how to assist here.  You can look into various oob implementation like path predicate, tag input matches almost what you are doing.

 

Hi Sham

Its worked, Do you have any idea how to get the payload in dialog participant step as in my dialog file there is listener, inside it i need the payload.

Thanks

 

Hi vdhim,

    Your implementation does not looks right. Refer [1] how to pass value between widgets.
 [1]   http://helpx.adobe.com/experience-manager/using/dynamically-updating-aem-custom-xtype.html
 
Thanks,
Sham
Tweet: @adobe_sham