colorfield and datasource | Community
Skip to main content
Level 6
February 24, 2021
Solved

colorfield and datasource

  • February 24, 2021
  • 2 replies
  • 4732 views

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.

2 replies

Ankur_Khare
Community Advisor
Community Advisor
February 24, 2021

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

 

 

Level 6
February 24, 2021
I thought of this, but my only concern is, wont the servlet call make the actions taken in a dialog slow?
Anudeep_Garnepudi
Community Advisor
Anudeep_GarnepudiCommunity AdvisorAccepted solution
Community Advisor
February 24, 2021
Level 6
February 24, 2021
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?