Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
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