Skip to main content
Participating Frequently
July 26, 2011
Answered

Dynamic dropdowns

  • July 26, 2011
  • 1 reply
  • 473 views

Hello

I need to creat the content of a dropdowns menu from an array.

But it dont accept "stringList:

    ".

Cane you help me ?

Thanks

My code :

list=[];
for (i = 0; i < 150; i++)
{
    list.push ("item"+i)
}  

    var myDialog = app.dialogs.add({name:"my dialog box", canCancel:true});
    with(myDialog){
        with(dialogColumns.add()){
            with(dialogRows.add()){
           
               
                    var typeDeCharte = dropdowns.add({stringList:

    , selectedIndex:0});
                     
                   
                }
               
               
               
               
               
            }}
        myDialog.show();

This topic has been closed for replies.
Correct answer Jongware

That's because this is a syntax error:

But it dont accept "stringList:

    ".

The documentation says "stringList accepts an array of strings", and you are handing it an array that contains one element -- which is another array.

This will make it work:

stringList:list

(Be Nice To People Trying To Help You and next time use the Syntax Highlighting function in the forum. It makes your sample code marginally easier to read.)

1 reply

Jongware
Community Expert
JongwareCommunity ExpertCorrect answer
Community Expert
July 26, 2011

That's because this is a syntax error:

But it dont accept "stringList:

    ".

The documentation says "stringList accepts an array of strings", and you are handing it an array that contains one element -- which is another array.

This will make it work:

stringList:list

(Be Nice To People Trying To Help You and next time use the Syntax Highlighting function in the forum. It makes your sample code marginally easier to read.)

jeanmedAuthor
Participating Frequently
July 27, 2011

Thanks