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

Drop Down referencing

Avatar

Level 2

I have a drop down list as follows:

Text, value

Jan, 1

Feb, 2

....

Dec, 12

Select Mth, 0 (Default)

I wish to use the change event and get the new value.

this.xfa.event.newText = the new selected TEXT item

this.xfa.event.prevText = previous selected TEXT item

this.rawValue = VALUE of the previous selected item

Question: How do I get the VALUE of the new selected item?

1 Accepted Solution

Avatar

Correct answer by
Level 10

I think you want this.boundItem(xfa.event.newText).

I use this to act on the newly selected value in a ddl.

In this example I'm using the value in a ddl to feed values to another ddl:

var selection = this.boundItem(xfa.event.newText);

Desc.clearItems();

Desc.rawValue = "";

SampleDescription.rawValue = "";

switch (selection)

{

     case "AE":

          SampleState.rawValue = "Air Emission";

          Desc.addItem("DF");

          Desc.addItem("FR");

          Desc.addItem("MS");

          Desc.addItem("PC");

          break;

}

Using this method everything updates right away, so you can arrow through a ddl and get immediate feedback.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

I think you want this.boundItem(xfa.event.newText).

I use this to act on the newly selected value in a ddl.

In this example I'm using the value in a ddl to feed values to another ddl:

var selection = this.boundItem(xfa.event.newText);

Desc.clearItems();

Desc.rawValue = "";

SampleDescription.rawValue = "";

switch (selection)

{

     case "AE":

          SampleState.rawValue = "Air Emission";

          Desc.addItem("DF");

          Desc.addItem("FR");

          Desc.addItem("MS");

          Desc.addItem("PC");

          break;

}

Using this method everything updates right away, so you can arrow through a ddl and get immediate feedback.

Avatar

Level 2

Yes!

this.boundItem(xfa.event.newText) works here!

Many thanks