Hi,

I am facing issue as to changing the combobox selected state as per my
requirement, the data of the combobox is coming from php and database,
there is no problem in changing the state of the combobox whose data
is coming from internal model structure.

I am pasting the code for your reference

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="init()">
        <mx:Script>
                <![CDATA[
                import mx.rpc.events.ResultEvent;
                import mx.rpc.events.FaultEvent;
                import mx.controls.Alert;
                import mx.events.CloseEvent;
        import flash.net.SharedObject;
        import mx.events.AIREvent;

    import flash.desktop.NativeApplication;
    import flash.display.Sprite;
    import flash.events.InvokeEvent;
        import mx.core.Window;
        [Bindable]
                           private var PBWFormInfo:XML;
                                                //private var shippingInfoNode;


                public function handleXML(event:ResultEvent):void
            {
                PBWFormInfo = event.result as XML;

                //Alert.show(shippingInfo);
               //shippingInfoNode=shippingInfo.option;
            }

                public function handleXMLFault(event:FaultEvent):void
                {
                   Alert.show(event.fault.faultString, "Error");
                }
                        public function init():void {


                xmlRPC.send();

                //this cb is populated from php and the selected item
is the issue
                myCB.selectedIndex=5;

                //this cb is populated from internal model data and
this is working fine
                wup_age.selectedIndex=1;

             }


                ]]>
        </mx:Script>
        <mx:ComboBox x="243" y="105" id="wup_age" dataProvider="{myDP.item}">

        </mx:ComboBox>
        <mx:Model id="myDP">
      <obj>
         <item label="AL" data="Montgomery"/>
         <item>
            <label>AK</label>
            <data>Juneau</data>
         </item>
         <item>
            <label>AR</label>
            <data>Little Rock</data>
         </item>
      </obj>
   </mx:Model>
<mx:HTTPService result="handleXML(event);"
fault="handleXMLFault(event);" id="xmlRPC" resultFormat="e4x"
        url="http://localpath/getpreference.php"; useProxy="false">
            <mx:request xmlns="">

            </mx:request>
        </mx:HTTPService>
        <mx:ComboBox x="124" y="105"
dataProvider="{PBWFormInfo.AgeGroups.AgeGroup}" id="myCB"></
mx:ComboBox>

</mx:WindowedApplication>




In php file the code is

<?php
include_once("ez_sql.php");

        header ("content-type: text/xml");
        echo "<?xml version='1.0' ?> ";
        echo "\n";
        echo "<PWData>\n";
                echo "<AgeGroups>\n\t";
                        echo "<AgeGroup wup_age='15'>15</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='16'>16</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='17'>17</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='18'>18</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='19'>19</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='20'>20</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='21'>21</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='22'>22</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='23'>23</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='24'>24</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='25'>25</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='26'>26</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='27'>27</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='28'>28</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='29'>29</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='30'>30</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='31'>31</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='32'>32</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='33'>33</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='34'>34</AgeGroup>\n\t";
                        echo "<AgeGroup wup_age='35'>35</AgeGroup>\n";
                        echo "<AgeGroup wup_age='36'>36</AgeGroup>\n";
                        echo "<AgeGroup wup_age='37'>37</AgeGroup>\n";
                        echo "<AgeGroup wup_age='38'>38</AgeGroup>\n";
                        echo "<AgeGroup wup_age='39'>39</AgeGroup>\n";
                        echo "<AgeGroup wup_age='40'>40</AgeGroup>\n";
                        echo "<AgeGroup wup_age='41'>41</AgeGroup>\n";
                        echo "<AgeGroup wup_age='42'>42</AgeGroup>\n";
                        echo "<AgeGroup wup_age='43'>43</AgeGroup>\n";
                        echo "<AgeGroup wup_age='44'>44</AgeGroup>\n";
                        echo "<AgeGroup wup_age='45'>45</AgeGroup>\n";
                        echo "<AgeGroup wup_age='above'>above</AgeGroup>\n";
                echo "</AgeGroups>\n";
                echo "\n";



There is no problem in the population of combobox from the php file,
only selecting index is the issue
If anybody have solved this type of issue Please let me know.

Thanks for help in advance

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to