Check out DataEvent.UPLOAD_COMPLETE_DATA.
Using your example...

import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import flash.net.FileReference;

private var _request:URLRequest = new
URLRequest("[L=http://localhost/demoApp/upload.cfc?method=doImport";);]ht\
tp://localhost/demoApp/upload.cfc?method=doImport");[/L]
[Bindable]
private var acContacts:ArrayCollection;

/* gets called via a button click by the user*/
public function importContacts(): void{
_request.method = URLRequestMethod.POST;
_request.data = params;
_fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, dataComplete);
_fileRef.upload(_request);

/* here is where I am stuck, I want to populate the grid with the
query*/
acContacts = ??
}

public function dataComplete(event:DataEvent):void {
Alert.show(event.data, 'Upload Complete');
}

<mx:Button label="Import Contacts"
icon="@Embed(source='../assets

/importIcon.png')"
click="importContacts()"/>

<mx:DataGrid id="dgImportList" dataProvider="{acContacts}" width="897"
height="308" />




On Sat, Apr 5, 2008 at 6:29 PM, malik_robinson <[EMAIL PROTECTED]>
wrote:

>   Hi,
>
> I am using Flex 3 and I would be quite grateful if someone can assist me
> here.
>
> I am trying to find out if I can return a query back to flex so I can
> populate this datagrid, but what makes this situation unique is I am
> uploading a csv file from flex and in ColdFusion converting it into
> query object (all this works), and lastly I want to return the query
> back to flex so I can populate the datagrid. Here is the code snippet:
>
> import mx.collections.ArrayCollection;
> import mx.rpc.events.ResultEvent;
> import flash.net.FileReference;
>
> private var _request:URLRequest = new
> URLRequest("[L=http://localhost/demoApp/upload.cfc?method=doImport";);]ht\
> tp://localhost/demoApp/upload.cfc?method=doImport");[/L]
> [Bindable]
> private var acContacts:ArrayCollection;
>
> /* gets called via a button click by the user*/
> public function importContacts(): void{
> _request.method = URLRequestMethod.POST;
> _request.data = params;
> _fileRef.upload(_request);
>
> /* here is where I am stuck, I want to populate the grid with the
> query*/
> acContacts = ??
> }
>
> <mx:Button label="Import Contacts"
> icon="@Embed(source='../assets/importIcon.png')"
> click="importContacts()"/>
>
> <mx:DataGrid id="dgImportList" dataProvider="{acContacts}" width="897"
> height="308" />
>
> I am not getting an error I just don't know how to have this function
> return my query object. Is this possible?
>
> Any help highly appreciated.
>
>  
>



-- 

"Every child has many wishes. Some include a wallet, two chicks and a cigar,
but that's another story."

Reply via email to