Expand my Community achievements bar.

Misleading Description for setItems() Method

Avatar

Level 10

I played around with the setItems method to push values into drop down list.

This is what the documentation says about its parameters:

param1

A list of items and values separated by a comma. For example, "One,Two,Three" or "One,1,Two,2,Three,3". For items without values, leave the value blank. For example, "item1,value1,item2,item3".

param2

The number of columns per item. For example, the itemValueList string, "One,1,Two,2,Three,3" has numColumns=2. An itemValueList "One,Uno,1,Two,Due,2,Three,Tre,3" has numColumns=3 while an itemValueList "One,Two,Three" has numColumns=1. The value of 1 is the default.

From that you might think you can use setItems("One,Uno,1,Two,Due,2,Three,Tre,3", 3); to create a 3 columns drop down list.

<items>

               <text>One</text>

               <text>Two</text>

               <text>Three</text>

            </items>

            <items>

               <text>Uno</text>

               <text>Due</text>

               <text>Tre</text>

            </items>

            <items save="1" presence="hidden">

               <text>1</text>

               <text>2</text>

               <text>3</text>

            </items>

This is just wrong.

The XFA specification only allows 2 <items> elements for field elements, so the setItem() method will always fail if the second parameter is larger than 2.

0 Replies