1 Reply Latest reply on Feb 5, 2010 4:12 AM by RUSH-ME

    Selected item in ComboBox

    Francisc Level 3

      Hello!

       

      I have a ComboBox with a dataProvider similar to this:

       

      myDP:ArrayCollection=new ArrayCollection({id:1,name:"JJ The Clown"},{id:2,name:"John John"}); //etc

       

      How can I set the selectedItem / selectedIndex if I `know` the id property of the object?

        • 1. Re: Selected item in ComboBox
          RUSH-ME Level 3

          Hi

           

          If you know the id and the id is unique the search the myDP using forloop. If id matches the then assign the whole object to the selectedItem of the combobox.

           

          Or you can assign the index of that object to the selectedIndex property of combobox.

           

          Hope this helps

          Rush-me