Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

DropDown List resetData

Avatar

Level 7

Does anyone know why does the first dropdown list1 reset itself when the code is supposed to reset dropdown list2. When I save the form as Static it works fine. The problem occurs when I save it as dynamic.Below is the code...

var newValue = this.boundItem(xfa.event.newText);
switch(newValue)
    {
    case "1":
        xfa.host.resetData("xfa.form.form1.page1.dl2");
            break;
    case "2":
        xfa.host.resetData("xfa.form.form1.page1.dl2");
            break;
    }

Is this a bug?


Aditya

5 Replies

Avatar

Level 10

It all depends on what value is passed to the switch statement.. Is the value is of String type or Numeric type?

Try removing the double quotes around 1 and 2 values..

Try placing the code in the change event.

Thanks

Srini

Avatar

Level 7

I am passing String Values like country names "Canada", "USA", etc.

The code is in the change event.

Aditya

Avatar

Level 10

Aditya,

    If you can send the form to LiveCycle9@gmail.com so I can have a look at it.. Please mention where the issue is..

Thanks

Srini

Avatar

Level 10

Aditya,

     Try moving the code from Change event to Exit event..

var newValue = this.rawValue;

switch(newValue){
case "Canada":
  xfa.host.resetData("xfa.form.form1.page1.dl2");
  break;
case "USA":
  xfa.host.resetData("xfa.form.form1.page1.dl2");
  break;
}

I set the file as Dynamic XML form for my test..

Thanks

Srini

Avatar

Level 7

Srini,

Thanks a lot! It worked...

Aditya