Page 1 of 1

DropDownList update

Posted: September 17th, 2014, 3:16 am
by bkan
Hello,
I've got a problem to update my DropDownList in my UI. I don't know how to change the value in this DropDownList. I've got a button in my UI which update my list, it works, but i don't know how i can repopulate my DropDownList .

A part of my code :

maListe:DropDownList{properties:{items:" + tableauAddMatte.toSource() + "}}\

function addMatte_update(){
var proj = app.project;
var tempTab = new Array();
for(var i=1;i<=proj.numItems;i++){//ca scanne les comps dans le projet
var numeros=i;
var myItems = app.project.item(i);
if (myItems instanceof FolderItem && myItems.name=="INK MATTES" ) {
for(var j=1;j<myItems.numItems+1;j++){
tempTab.push(myItems.item(j).name);

}
}
if(i==proj.numItems){

HERE I HAVE TO POPULATE MY DropDownList WITH THE CONTENT OF MY ARRAY "tempTab"


//alert(tableauAddMatte);
}
}
}

Thank you!

Re: DropDownList update

Posted: September 17th, 2014, 2:44 pm
by beginUndoGroup
you can specify items as an array upon creation, but after you can only add them one by one.

remove all items from the list:
maListe.removeAll();

remove item k from the list:
maListe.remove(maListe.items[k]);

add one item to the list at index k
maListe.add("item", "xxx", k) // if k not specified, appends the items at the end

Xavier

Re: DropDownList update

Posted: September 18th, 2014, 8:10 am
by bkan
OK, thank you, it works!