Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Read dialog values from datasource

Avatar

Level 5

hi all,

 

in the dialog I have tag picker and dropdown with datasource.

 

I need to populate dropdown with list of child tags for the parent tag selected in tag picker.

What I haven't managed to figure out is how to read dialog props. from datasource handler class.

I tried with sling model and with WCMUsePojo.

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

The change event should work with tag picker as well. Please let me know if eventing does not work.



Arun Patidar

View solution in original post

4 Replies

Avatar

Community Advisor

Hi,

You need to convert datasource from sling model to servlet and populate dropdown based on parent value via making a ajax call to datasource servlet with parent tag.

e.g. https://github.com/arunpatidar02/aem63app-repo/blob/master/js/dynamic-dropdown.js

 



Arun Patidar

Avatar

Level 5

Thank you Arun.

 

This looks like my use case, I'll check it out and let you know if I have additional questions.

Bottom line is I should use approach from your second link to get value from first component and use servlet to get list of tags to populate dropdown.

 

Is there other handler for oob tag picker (cq/gui/components/coral/common/form/tagfield), I believe applying class to tag picker will not be applied and also I think change event will not be triggered by tag picker changes ?

 

    $document.on("change", contentTypeSelector, function (e) {
        setSubTypeDropdown(false);
    });

 

Thank you

Happy new year.

Avatar

Correct answer by
Community Advisor

Hi,

The change event should work with tag picker as well. Please let me know if eventing does not work.



Arun Patidar