0

hi! I need to populate a flex combobox with the result query of a oracle db, using coldfusion.
I have this code, but it is not functioning:

my flex webpage:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
	
	<mx:Label x="230" y="36" text="Selecionar Consolas"/>
	
<mx:Script>
        <![CDATA[
            
            import mx.events.*;
            import mx.collections.*;
            import mx.rpc.events.ResultEvent;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.events.ListEvent;
            import mx.core.Application; 

            [Bindable]
            public var Result: ArrayCollection;
	        public function ResulQuery(event:ResultEvent):void
            {
        	    Result = event.result as ArrayCollection;
            }
	
public function datos():void
        {
        conexionbd.listar_consolas.send();
        }
        
	]]>
</mx:Script>


	<mx:WebService id="conexionbd"  wsdl="http://127.0.0.1:8500/conexionbd.cfc?wsdl">
		<mx:operation name="listar_consolas" result="ResulQuery(event)">
			
		</mx:operation>
    </mx:WebService>
    
    
<mx:ComboBox x="230" y="76" dataProvider="{Result}" labelField="plataforma_producto"></mx:ComboBox>
	
    
    
</mx:Application>

my coldfusion webservice:

<cfcomponent>
	
	<cffunction name="listar_consolas" returnType="Query" access="remote" >
		<cfquery name="qGet" datasource="conexionbd" >
			select plataforma_producto
			from producto
			where tipo_producto=1 and status='i'
		</cfquery>
		<cfreturn qGet>
	</cffunction>


</cfcomponent>

Why is not working?

1
Contributor
1
Reply
3
Views
5 Years
Discussion Span
Last Post by montjoile
0

I already solved my problem with the following code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
	
	<mx:Label x="230" y="36" text="Selecionar Consolas"/>
	
<mx:Script>
        <![CDATA[
            
            import mx.events.*;
            import mx.collections.*;
            import mx.rpc.events.ResultEvent;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.events.ListEvent;
            import mx.core.Application; 

            [Bindable]
            public var Result: ArrayCollection;
	        public function ResulQuery(event:ResultEvent):void
            {
        	    Result = event.result as ArrayCollection;
            }
	
public function datos():void
        {
        conexionbd.listar_consolas.send();
        }
        
	]]>
</mx:Script>


	<mx:WebService id="conexionbd"  wsdl="http://127.0.0.1:8500/conexionbd.cfc?wsdl">
		<mx:operation name="listar_consolas" result="ResulQuery(event)">
			
		</mx:operation>
    </mx:WebService>
    
    
<mx:ComboBox x="230" y="76" dataProvider="{Result}" labelField="PLATAFORMA_PRODUCTO" creationComplete="datos()"></mx:ComboBox>
	
        
</mx:Application>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.