Read dialog values from datasource | Community
Skip to main content
Level 4
Dec 31, 2021 12:44 PM UTC
Solved

Read dialog values from datasource

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Jan 3, 2022 7:58 AM UTC

Hi,

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

Arun Patidar

4 replies

arunpatidar
New Participant
Jan 1, 2022 4:06 PM UTC
Arun Patidar
nbg62Author
Level 4
Jan 2, 2022 5:20 PM UTC

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.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Jan 3, 2022 7:58 AM UTC

Hi,

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

Translate
Arun Patidar
arunpatidar
New Participant
Dec 31, 2021 4:05 PM UTC

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

 

Translate
Arun Patidar