Avatar

Correct answer by
Level 10

Hi

In the preOpen event of your dropdown you can add the items to your dropdown with the following code;

var dropdownitems = [];

var rows = xfa.resolveNodes("Row[*]");

for (var i = 0; i < rows.length; i++)

{

    dropdownitems.push(rows.item(i).TextField1.rawValue + " " + rows.item(i).TextField2.rawValue);

    dropdownitems.push(rows.item(i).index);

}

this.setItems(dropdownitems.join(","), 2);

This assumes the text fields are called TextField1 and TextField2 are in repeating subform called “Row”.

The value of the dropdown will become the index of the row containing the text fields.

This assumes your users are using Reader 9.0 or above.  If not you will have to do something similar but the with clearItems and addItem methods.

Regards

Bruce

View solution in original post