Expand my Community achievements bar.

Populate dynamic DropDownList and its values

Avatar

Level 7

I have about 350 items to populate dynamic into a DDL..

Every Item has two values to export(CC and FAC).

I have succesfully export with my example only one value.

How I can export Both values?

Thanks again

5 Replies

Avatar

Level 7

I am sorry, when I say To export I mean populate the DDL values into CC and FAC Fields.

Thanks

Avatar

Level 10

Hi,

Here is an example showing how to access the display value and the bound value of a dropdown.

Hope that helps,

Niall

Avatar

Level 10

Sorry,

Just looked at the xml file and see that you have a display value and two bound values. The previous example will not work here. I will have a look and see if I can come up with anything.

N.

I tried this, but it didn't work. I am trying to access the dataset to get the FAC value.

var vDepart = xfa.datasets.data.TEST1;

var i = Departments.selectedIndex;

oFAC.rawValue = vDepart.item(i).FAC.value;

This was in the calculate event of the FAC object (which I renamed to oFAC to keep it different from the xml file item).

Hope someone can help you.

N,

Avatar

Level 10

OK, I am stumped by this!!

The example I was referring to is here: Re: is it possible to get the key/value of the dropdown?

John Brinkman's blog deals with dropdowns, and issues like setItems() and addItem().

One of his entries states (Populating list boxes):

"One of the Reader 9 enhancements was a new API call to populate list boxes:field.setItems(). The motivation for the new API is to provide better performance for populating lists.

Prior to Reader 9, the standard way to populate a list box is to call:

field.addItem(displayValue [, boundValue])

for each item in the list.  The new API looks like:

field.setItems(itemListString [, numColumns])

The first parameter is a comma-separated list of values, the second parameter is an integer telling the field how many columns are in the data (defaults to one).  The second parameter is designed for future extensibility if we choose to some day implement a multi-column list box."

Now, while you can bind multiple categories to an item in xml dataset, I don't know how to access bound vales after the first bound value.

Hopehully Paul, Jono or Bruce will have the solution.

Sorry,

N.

Avatar

Level 7

Thanks very much Niall, I really appriciate all your help in this matter!