1 Reply Latest reply on Jul 22, 2010 11:18 AM by majester8425

    Spark Dropdownlist will not set data to selectedindex following refresh ???

    majester8425

      I have a dropdown list item on a form which gets populated from an ArrayCollection. The value selected is set depending on the value retrieved from a database for the given data being displayed.

       

      This works fine using the following code. Finds a match in the ArrayCollection to the retried data and sets the selectedindex. Works 100% until I update some other bit of data and refresh the screen. The code still works and the selectedindex value is set correctly, but the dropdown is now blank. If I change it to a combobox its fine, but I don’t want to allow users to enter a value in the combobox.

       

       

      for (i = 0; i < teamAc.length; i++)

      {

                      if (teamAc[i].team_id == event.result.item.team_id_op)

                      {

                                      teamDd.selectedIndex = i;

                                      break;

                      }   

                      else

                      {

                                      teamDd.selectedIndex = -1

                      }

      }