Hi

Use a function to do your selection        

<mx:ComboBox dataProvider="{typeToitureModel.toiture.type}" 
value="3302" creationComplete="doSelection(event)"/>

            function doSelection( event  : Object ) : Void
            {
                         var comboBoxID = event.target;
                        // In my case I always prefer to keep first
element in Combo Box as PLEASE SELECT label.
comboBoxID.addItemAt(0,"Please Select", "");
                         comboBoxID.selectedIndex = 0;
            }

Thanks,

Shahnavaz        

________________________________________
From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Ghislain Simard
Sent: Sunday, July 17, 2005 12:41 PM
To: [email protected]
Subject: [flexcoders] get ComboBox selected item with RemoteObject

Hi,
How can we get an item selected in a ComboxBox when it's coming from 
a RemoteObject?

my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>

<mx:RemoteObject id="toitureObject" source="EEwizard3.G.toit_nf">

  <mx:method name="affichage" result="resultHandler(event.result)">
    <mx:arguments>
      <zoneID>1</zoneID>
    </mx:arguments>
  </mx:method>
</mx:RemoteObject>      
      
<mx:Script>
<![CDATA[
   var iniVal:Object;
   function resultHandler(result){
      iniVal = result;
   }
]]>
</mx:Script>
<mx:Model id="typeToitureModel">
  <toiture>
    <type>
      <label>Type I</label>            
      <data>3300</data>
    </type>
    <type>
      <label>Type II</label>            
      <data>3301</data>
    </type>            
    <type>
      <label>Type III</label>            
      <data>3302</data>
    </type>                                    
  </toiture>
</mx:Model>
      
<mx:Button label="Get Data" click="getdata();"/>

<mx:ComboBox dataProvider="{typeToitureModel.toiture.type}" 
value="3302" selectedItem="{???????????}"/>

</mx:Application>


Thanks





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 

SPONSORED LINKS 
Computer software testing 
Macromedia flex 
Development 

Software developer 
        

________________________________________
YAHOO! GROUPS LINKS 

&#61607;         Visit your group "flexcoders" on the web.
  
&#61607;         To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
  
&#61607;         Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 

________________________________________





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to