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

On select dynamically update Touch UI Dialog

Avatar

Level 3

Update the options of a drop down Touch UI Select according to the value of another Select .

I have a requirement like on select of a first drop down it should call a rest service and based on the first drop downselection its should populate the 2nd drop down dialog field . I am new to touch ui if anybody has already worked on this kind of requirement please help me Thanks in Advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10
10 Replies

Avatar

Level 10

All drop-downs can be set using a DataSource object - i recommend you to go through this artilce to learn how to dynamically populate a select field -- Scott's Digital Community: Using an WCMUsePojo class to populate an Experience Manager Touch UI Sele...

Avatar

Level 10

SO in this example - you can use Java logic to set a DataSource object for the second Select field. But start with that artilce to learn how to populate a Select field via code.

Avatar

Level 3

Hi Scott,

can u please let me know how can i populate 2nd drop down on select of 1st drop down .correct me if i am wrong this above link only work after submit the dialog, does it work for on select of 1st  drop down to auto-populate for 2nd drop down.

Avatar

Level 10

We have have to write a custom event handler that is fired to back-end service when the 1st drop down is selected.  I will discuss and get back to you.

Avatar

Correct answer by
Level 10

Avatar

Level 3

Thanks Scott for sharing the above links ill check all these links and let you know.

Avatar

Level 3

Hi Scott/Sreekanth,

http://experience-aem.blogspot.com/2015/04/aem-6-sp2-touchui-adding-dynamic-select-options .html

The above link nicely working for me in 6.3 i will use this for my requirement.Thanks a lot....

Avatar

Level 1

Hi Scott/Sreekanth,

http://experience-aem.blogspot.com/2015/04/aem-6-sp2-touchui-adding-dynamic-select-options .html

is not working in AEM 6.2.

Here are some of the issues:

1. A warning "An instance of Select is already attached to the specified target element. Future versions of CoralUI will throw an exception at this point."

2. capital._select.val(event.selectedValue).trigger('change'); - TypeError: capital._select.val is not a function

Thanks,

Mahder

Avatar

Level 1

hi,

i need a sling model example to populate 2nd drop down list auomatically click on 1st one...please...thanks in advance