Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Read dialog values from datasource

urosk
Level 2
Level 2

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
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

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

View solution in original post

4 Replies
Arun_Patidar
Community Advisor
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

 

urosk
Level 2
Level 2

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.

Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

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

View solution in original post