Alert.show(ProcessorName.selectedItem.lastResult) to
Alert.show(ProcessorName.selectedItem.id) -TH --- In [email protected], Jeremy Watson <[EMAIL PROTECTED]> wrote: > > Hey Guys, > > Man this combo thing is pissin me off! Let me ask this simple question first. > > Is this the correct way of getting data out of the database and into the combobox? What I'm trying to do is just get the ID out of the combobox and alert it. ONCE i get that far I would like to call another function (yet to be created) which will do a remote call and bring in values to bind to a text box based on what was selected from the combo box (can this even be done?). Does that make sense? I would've had this done in about 10 mins in CF and HTML....god do I miss it. > > My Example code is below. Any help would be grateful. > > Jeremy. > > > <mx:Script> > <![CDATA[ > import flash.events.Event; > import mx.events.DropdownEvent; > import mx.collections.ArrayCollection; > import com.sml.cows.DrawDown; > import com.sml.cows.MyDropDownTCowsR_Processor; > import mx.utils.ObjectUtil; > import mx.events.FlexEvent; > import mx.formatters.NumberBase; > import mx.controls.TextArea; > import mx.messaging.messages.AcknowledgeMessage; > import mx.controls.Alert; > //import mx.rpc.remoting.RemoteObject; > import mx.utils.ArrayUtil; > import mx.rpc.events.ResultEvent; > import mx.rpc.Fault; > import mx.rpc.events.FaultEvent; > import mx.rpc.soap.mxml.WebService; > import mx.events.ValidationResultEvent; > import mx.events.ItemClickEvent; > import mx.events.DropdownEvent; > import mx.events.ListEvent > > public function onCreationComplete( event:FlexEvent):void > { > > remoteService.getProcessors(); > > } > > // Display the type of event for open and close events. > private function dropEvt(event:DropdownEvent):void { > forChange.text+=event.type + "\n"; > } > > // Display a selected item's label field and index for change events. > private function changeEvt(event:Event):void { > Alert.show (ProcessorName.selectedItem.lastResult) > forChange.text+=event.currentTarget.selectedItem.label + " " + > event.currentTarget.selectedIndex + "\n"; > } > ]]> > </mx:Script> > <mx:RemoteObject id="remoteService" destination="ColdFusion" source="Cows3.cows" showBusyCursor="true"/> > > <mx:ComboBox id="ProcessorName" change="changeEvt(event)" open="dropEvt(event)" close="dropEvt(event)" dataProvider="{remoteService.getProcessors.lastResult}" labelField="ProcessorName" x="403" y="97"> > </mx:ComboBox> > > <mx:ComboBox open="dropEvt(event)" close="dropEvt(event)" change="changeEvt(event)" > > <mx:ArrayCollection> > <mx:Object label="AL" data="Montgomery"/> > <mx:Object label="AK" data="Juneau"/> > <mx:Object label="AR" data="Little Rock"/> > </mx:ArrayCollection> > </mx:ComboBox> > <mx:TextArea id="forChange" width="150" height="100%"/> > </mx:Application> > > > > > Send instant messages to your online friends http://au.messenger.yahoo.com >

