0 Replies Latest reply on Aug 23, 2012 11:35 AM by RedLabsSA

    Flex changes in a Spark DropDownList


      New with flex, and need some advice. See the following code i got from a blog:



          <?xml version="1.0"?>

          <!-- http://blog.flexexamples.com/2009/04/09/determining-when-the-selected-item-changes-in-a-sp ark-dropdownlist-control-in-flex-gumbo/ -->

          <s:Application name="Spark_DropDownList_change_test"







                  import spark.events.IndexChangeEvent;


                  protected function dropDownList_changeHandler(evt:IndexChangeEvent):void {

                      lbl.text = "You selected " + dropDownList.selectedItem.team;






              <s:ArrayList id="arrList">

                  <fx:Object team="Los Angeles" name="Angels of Anaheim" />

                  <fx:Object team="Seattle" name="Mariners" />

                  <fx:Object team="Oakland" name="Athletics" />

                  <fx:Object team="Texas" name="Rangers" />

                  <fx:Object team="Cleveland" name="Indians" />

                  <fx:Object team="Detroit" name="Tigers" />

                  <fx:Object team="Minnesota" name="Twins" />

                  <fx:Object team="Chicago" name="White Sox" />

                  <fx:Object team="Kansas City" name="Royals" />

                  <fx:Object team="Boston" name="Red Sox" />

                  <fx:Object team="New York" name="Yankees" />

                  <fx:Object team="Toronto" name="Blue Jays" />

                  <fx:Object team="Baltimore" name="Orioles" />

                  <fx:Object team="Tampa Bay" name="Rays" />

                  <fx:Object team="Arizona" name="Diamondbacks" />

                  <fx:Object team="Colorado" name="Rockies" />

                  <fx:Object team="San Diego" name="Padres" />

                  <fx:Object team="Los Angeles" name="Dodgers" />

                  <fx:Object team="San Francisco" name="Giants" />

                  <fx:Object team="Chicago" name="Cubs" />

                  <fx:Object team="Milwaukee" name="Brewers" />

                  <fx:Object team="St. Louis" name="Cardinals" />

                  <fx:Object team="Houston" name="Astros" />

                  <fx:Object team="Cincinnati" name="Reds" />

                  <fx:Object team="Pittsburgh" name="Pirates" />

                  <fx:Object team="Philadelphia" name="Phillies" />

                  <fx:Object team="New York" name="Mets" />

                  <fx:Object team="Atlanta" name="Braves" />

                  <fx:Object team="Washington" name="Nationals" />

                  <fx:Object team="Florida" name="Marlins" />




          <s:VGroup horizontalCenter="0" top="10">

              <s:DropDownList id="dropDownList"



                      prompt="Please select a team..."

                      change="dropDownList_changeHandler(event);" />

              <s:Label id="lbl" />





      What I`m trying to do is get data from a XML file, and where the difference is selected the Lable`s will show the details for example:



      I have 2 people in the xml:




            <clientName>First Names</clientName>




            <dateBooked>Thu Aug 23 00:00:00 GMT+0200 2012</dateBooked>

            <dateRequired>Fri Aug 31 00:00:00 GMT+0200 2012</dateRequired>


            <itemType>PC Box Only</itemType>

            <clientComments>Wont Power up

          Problem loading windows</clientComments>

            <clientRequirements>format and re-install

          backup document</clientRequirements>


            <itemNotes>Damage on front panel

          Damage on back panel</itemNotes>



      Where from the "dropdownlist" I selected the first person, his details would appear in the "Lable" field (SEE CODE ABOVE).



      Help! :-)