Selection Dropdown values dynamically. | Community
Skip to main content
Mani_kumar_
New Participant
Mar 14, 2016 3:21 PM UTC
Solved

Selection Dropdown values dynamically.

Hi All,

We have requirement where we need configure the pagepath in dialog and display list of component names in selection dropdown.

attaching screenshot.

Thanks,

Mani Kumar K

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Mani_kumar_
Mani_kumar_Accepted solution
New Participant
Mar 15, 2016 1:46 PM UTC

Hi All,

Got the solution please find below code snippet

function(){ 
var dialog = this.findParentByType('dialog');
var selectBox = dialog.findByType('selection')[0];
        $.getJSON('/libs/dropdown?Path=' + this.value, 
            function(jsonData){
                        selectBox.setOptions(jsonData);
                        });
 }

11 replies

edubey
Level 10
Mar 14, 2016 3:38 PM UTC

1. Have a simple widget listener on pathfield, which will call a servlet.

2. have a servlet which returns all component used in this page and populate drop down with the data returned via servlet [1]

[1] https://helpx.adobe.com/experience-manager/using/dialog_fields_servlets.html

Translate