views:

5

answers:

1

Hi,

I would like to add items to a dropdownlist progmatically.

I have an empty drop downlist and depending on a number of factors I then populate it with various action choices.

the Drop Down list is called dlFirstChoice and I would like to add some values to it, can some one give me the basic code to do so, I have tired ILists and Arrays as the Dataprovider but clearly Im doing something wrong.

Please and thank you in advance for any help.

A: 

var dropListDb:ArrayList=new ArrayList(); dropListDb.addItem({label: "Equals (List)"}); dropListDb.addItem({label: "Is Between"}); dlFirstChoice.visible = true; dlFirstChoice.dataProvider=dropListDb; dlFirstChoice.selectedIndex=0;

Craig Mc