Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Dynamic table row drop down list to change another drop down list in the same table

Avatar

Level 1

Hello all,

I have the following created where the table will have two drop down list.

The first problem category will be having, lets say x,y and z.

Next problem code depends on problem category that when x selected then it will create list of x1,x2,x3 or y selected then populate y1,y2,y3

1487677_pastedImage_0.png

I have the above mentioned created without any problem.

However, I am also having add row. So when come to second rows, the above function will not work anymore as it is different row objects.

What can I do to resolve this?

Thank you!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

This should be simple enough, what code are you using?

I would try something like this JavaScript in the preOpen event of the "Problem Code" field.

switch (Category.rawValue) {

case "X":

  this.setItems("X1,X2,X3");

  break;

case "Y":

  this.setItems("Y1,Y2,Y3");

  break;

case "Z":

  this.setItems("Z1,Z2,Z3");

  break;

}

Just change the "Category.rawValue" to match whatever you have called your field.

Regards

Bruce

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Hi,

This should be simple enough, what code are you using?

I would try something like this JavaScript in the preOpen event of the "Problem Code" field.

switch (Category.rawValue) {

case "X":

  this.setItems("X1,X2,X3");

  break;

case "Y":

  this.setItems("Y1,Y2,Y3");

  break;

case "Z":

  this.setItems("Z1,Z2,Z3");

  break;

}

Just change the "Category.rawValue" to match whatever you have called your field.

Regards

Bruce