Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

How do I get the selected value of a drop down whose items are generated at runtime?

$
0
0

I've been at this all day, with no luck.

 

I have a drop down whose values are generated at runtime via javascript on the Enter event. This code generates the list of items from another repeatable subform in the document:

 

this.clearItems();

var vItems = xfa.resolveNodes("People.Person[*]");
for(i=0; i<vItems.length; i++)
{  var name = vItems.item(i).DisplayName.rawValue;  if (name != null)  {    this.addItem(name);  }
}

 

This works perfectly. I can select any of the "DisplayName"s listed under the repeatable "Person" subform.

 

My problem is that it seems dynamically generating the possible values like this prevents me from reading the rawValue of the drop down. For example, I put the following in a button ("PersonName" is the dynamic drop down I'm working with):

 

xfa.host.messageBox(PersonName.rawValue);

 

When I click the button, nothing happens. if I point it at a different drop down that had their items defined statically within the GUI, the message box pops up and shows the current value, as expected.

 

The same goes for selectedIndex, boundItem, and pretty much everything else I've tried. What makes it stranger is that I'm still able to programatically set the rawValue... i.e.:

 

PersonName.rawValue = "Test";

 

What am I doing wrong here? I've even enabled debugging and watched for any exceptions... nothing. Any code I write that tries to read from a drop down whose values are generated at run time just doesn't seem to execute.

 

I would appreciate any help that you guys might be able to offer. Thanks!

 

-Scott


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>