Hello Dave and All,
I checked out the Article and it
worked!!
But I am confused why it
worked... In some respects, I thought I was doing the same thing - but
just in a different way. I was wondering if you could explain why one
piece of code works, and the code I originally used did NOT work. For
the example code below, you can all assume that I already declared a
public variable called 'categories', and cast it as an
ArrayCollection...
For starters, here is the code that
works from the Article:
categories = event.result as
ArrayCollection;
And
for the code that does NOT work:
categories = new ArrayCollection(event.result as
Array);
-or-
categories = new
ArrayCollection(event.result);
If I
understand your post correctly, you are saying that the "Event Object" performs
some type of "smart conversions" - only when it's being directly
assigned to a variable? And if that's true, this conversion never
gets triggered, when it's placed inside of a Constructor (for example an
ArrayCollection)? This would explain why my code did not
work.
I
don't know - just thinking out loud here. I would love to know more about
how this all works, especially since there were so MANY massive changes from
Flex 1.0 Beta, all the way to the latest release version (not to mention Flash
Remoting, which the earliest versions of Flex had a lot of similarities
to). I am sure learning how this all works, will save me a LOT of
headaches down the road - especially since I ONLY write Data-Driven applications
(RIA's) which all make massive amounts of database
calls.
Thanks
for all your wonderful advice!
Mike
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dave Carabetta
Sent: Thursday, July 27, 2006 1:04 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] How does Flex 2.0 handle ColdFusion Query results?
Hello Shannon :)Yes, I am doing precisely that. I was trying to avoid posting code, but it's the easiest way to show you everything I am trying to do. You can assume too, that yes I am bringing back a valid RecordSet from ColdFusion, and the FieldNames match up exactly with what was brought back. Since the data is all there, Flex for some reason, is not iterating through all the data and parsing it out properly. I just have a hard time with this - since this works fine with my Flash Remoting app, and that I am bringing back a native Query Object from ColdFusion. I must be missing something, or am not properly casting something. As far as I can tell, I am properly coding the Grid Columns - but maybe I am not... One last thing - I am running something similar to Flash's NetConnection Debugger - and I am for sure getting back a valid response from the CF Server - an Array of Objects, all properly formatted and casted.If you could shed further light, as to why no data shows up in my DataGrid when the app runs, I'd be very grateful :)
Mike,
A bit has changed between 1.5 and 2.0 with regard to Flex, and for the better (aka easier). To that end, yesterday I blogged a post on using Arrays vs. ArrayCollections in Flex and, at the bottom, there is a semi-complete MXML application that shows calling an HTTPService and handling the results for display in the DataGrid. In short, the new ResultEvent class should make its way into your code, as that class is the one that has the "smarts" to handle ColdFusion queries and cast it to an appropriate local data structure. Watch for link wrapping:
http://www.cbetta.com/blog/index.cfm/2006/7/26/array-vs-array-collection-in-flex-2-with-a-coldfusion-slant
Hope this helps.
Regards,
Dave.
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___