This content has been marked as final. Show 7 replies
OK, I suppose an example is in order.
Behold, the app which works in Flex 2 but not in Flex 3
The app throws an error here (line 23 in datastuff):
var facilitiesForComboBox:Array = new Array(facilityDataProvider.length);
because it did not place the results into the Array facilityDataProvider as it does in Flex 2.
First, the mxml app, then the two AS files.
The webservice is throwing a fault for me (i'm guessing its the "foo" in the WSDL url).
I'm guessing it's this line of code:
facilityDataProvider = event.result as Array;
I'm guessing the "event.result" can't be converted to an Array object and therefore is getting cast to null, therefore trying to access the length property of the array gives the error because you're trying to access a property (length) on a null object reference (facilityDataProvider).
What happens if you try and do the following on line 20:
I had to alter the url to obscure the name of the health care behemoth I work for. Any CF7 web service which returns a query containing the string columns NAMECLINIC and FACILITY should do. Email me [this.forumusername][at]akh[dot]com for the wsdl to the real service, if you'd like that. It's the same service used by our Flex 2 apps without issue.
The trace revealed the same thing I see in the Variables window when the app crashes into Debug perspective (something I failed to mention earlier): a lovely ArrayCollection containing an ArrayList containing 209 records...
Is that similar to the output from Flex 2?
No, they're not exactly the same (see below).
Calling the same web service; Flex 3 is generating a different result object than Flex 2, and therefore can/will not type the results as the Array my original app had come to expect. Is this by design?
A suggested code revision would help, but...
The question in my original post is still in play:
Where would I have gone to learn this? The release notes are simply a cut list of changes. Is there a resource which summarizes the types of errors one is likely to see when porting a Flex 2 app to Flex 3, along with the most-likely changes as causes? When CFMX was first released, there was a helpful checklist of tags and syntax to help you audit your CF5 for the upgrade. Has one of your gurus blogged something like this for FX3 and I just can't find it?
I don't know of such a document, but there may be something out there, or something may be written in the future.
As for the differences between Flex2/Array and Flex3/ArrayCollection, I've forwarded the question onto a couple engineers and will see what I can find out.
It could be that this scenario (and believe me there's not just a single scenario that could be involved for returning an Array from a WebService) in Flex 2 was a bug and the "makeObjectsBindable" setting may have been missed. Perhaps in Flex 3 this issue was fixed? Have you tried setting makeObjectsBindable explicitly to false?