colorfield and datasource | Community
Skip to main content
Level 6
Feb 24, 2021 4:21 AM UTC
Solved

colorfield and datasource

I have a component whose dialog has 2 colorfield in it. These colorfield are showing the color options from a ACS generic list using datasource node.

I want to modify this with:

when I select a color in the first colorfield, I want to show some colors in the swatch of the 2nd colorfield based on the selection of the 1st one.

Example:

1st pink--2nd black, white, yellow etc

1st green--2nd red, blue, teal etc

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Anudeep_Garnepudi
Anudeep_GarnepudiAccepted solution
New Participant
Feb 24, 2021 7:39 AM UTC

19 replies

Anudeep_Garnepudi
Anudeep_GarnepudiAccepted solution
New Participant
Feb 24, 2021 7:39 AM UTC
Level 6
Feb 24, 2021 10:03 AM UTC
I like this approach, I am trying to implement it in my colorfield. My first colorfield is using datasource from generic list while for the second one i will use your appraoch using json. That should work right?
Translate
Ankur_Khare
New Participant
Feb 24, 2021 4:44 AM UTC

You need to call a servlet on selection of 1st dialog field and get the response from servlet to poulate list in second field-

 

https://aem4beginner.blogspot.com/call-any-servlet-in-touchui-dialog-aem

 

 

Translate
Level 6
Feb 24, 2021 4:53 AM UTC
I thought of this, but my only concern is, wont the servlet call make the actions taken in a dialog slow?
Translate