1 Reply Latest reply on Apr 5, 2008 5:22 AM by slaingod

    Can I return a query object from a file upload using Flex 3?

    WestSide Level 1
      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(" http://localhost/demoApp/upload.cfc?method=doImport");
      [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?

      -Westside