|
|
Hello group,
I am looking for information on how to set the dataprovider of a combobox in
flash 8 to the result of a cfc method of cfdirectory in coldfusion. I would
like this to be
dynamic in that when a user uploads a file to the website that the flash
combobox will hold the name of the file in it. My cfdirectory tag returns a
list of files based on
the paramters supplied, but I am unable to get the data from cfc into the
dataprovider. Any help you could give me would be greatly appreaciated.
The method is as follows and when I invoke this method on a cfm page I get a
list of zip files in the directory folder of the template so I know the
method works
<cffunction name="getAllZipFiles" access="remote" returnType="query"
output="true">
<cfdirectory action="list"
directory="#GetDirectoryFromPath(GetTemplatePath())#" name="CurrentDir"
filter="*.zip">
<cfoutput query="CurrentDir">
#Name#<br>
</cfoutput>
<cfreturn CurrentDir>
</cffunction>
------------------------
I have a properly funtioning flash remoting setup so I know it is not that.
//Import the Flash Remoting Classes
import mx.remoting.Service;//import mx.remoting.NetServices;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
import mx.remoting.DataGlue;
//Connect to the Gateway
//Establish the Service
var myService : Service = new Service(
"http://localhost/flashservices/gateway",
new Log (Log.DEBUG),
"helloExamples.myRemote",
null,
null);
//Test the Connection
function getTestConn ()
{
//Create a PendingCall object
var testConn_pc : PendingCall = myService.getTestConn();
//Use the responder property to handle the success or failure
testConn_pc.responder = new RelayResponder (this, "getTestConn_Result",
"getTestConn_Fault");
}
//Handle the Success
function getTestConn_Result (re : ResultEvent)
{
//trace(re.result);
capText.text = re.result
//call the tabs query
//getTabs();
//getMyRules();
getZipFiles();
}
//Handle the Failure
function getTestConn_Fault (fault:FaultEvent):Void
{
trace ("error");
}
--------------------
I get an error that the data returned is not of a list type even though the
returnType is set to query when I test the movie.
12/25 20:37:6 [DEBUG] : helloExamples.myRemote.getAllZipFiles() returned
{code: "Server.Processing",
description: "The value returned from the getAllZipFiles function is
not of type list.",
details: "",
level: "error",
rootcause: {code: null,
description: "The value returned from the getAllZipFiles function
is not of type list.",
details: "",
level: "error",
type: ""},
type: ""}
--------------------
Here is the actionscript function for the combobox
//get all the zip files in the current directory
function getZipFiles ()
{
var ZipFiles_pc : PendingCall = myService.getAllZipFiles();
ZipFiles_pc.responder = new RelayResponder (this, "getZipFiles_Result",
"getZipFiles_Fault");
}
function getZipFiles_Result (re : ResultEvent)
{
DataGlue.bindFormatStrings(myCombo_cb,re.result,"#name#","#name#")
}
function getZipFiles_Fault (fault:FaultEvent):Void
{
trace ("error");
}
|
|