Sorry is that a problem with Cold Fusion? I get single element ArrayCollections from by java backend all the time (I think? :-)
On Thu, Nov 13, 2008 at 11:32 PM, Tracy Spratt <[EMAIL PROTECTED]>wrote: > Mike, > > It is dangerous to use lastResult in this manner: > > scans = new ArrayCollection([getScan.lastResult.vector.scan]); > > You are not garrunteed that it will have the value in the result you > expect. > > In most cases it will work ok but the correct way is: > > scans = new ArrayCollection([event.result.vector.scan]); > > > > lastResult is intended only for use in binding expressions. > > > > Tracy > > > ------------------------------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mike Duncan > *Sent:* Thursday, November 13, 2008 3:06 PM > *To:* flexcoders@yahoogroups.com > *Subject:* Re: [flexcoders] ArrayCollection > > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > This is how I got around this... > > - ------------- > import mx.uils.ObjectProxy; > import mx.collections.ArrayCollection; > > [Bindable] private scans:ArrayCollection; > > private function handleGetScansResults(event:ResultEvent):void { > //Note: getScan is a HTTPService object. > if(getScan.lastResult.vector.scan is ObjectProxy) { > scans = new ArrayCollection([getScan.lastResult.vector.scan]); > }else{ > scans = getScan.lastResult.vector.scan as ArrayCollection; > } > } > - ------------- > (sorry for any word wrapping) > > Dunno if someone else already suggested this, but I hope this helps. > > Mike Duncan > ISSO, Application Security Specialist > Government Contractor with STG, Inc. > NOAA :: National Climatic Data Center > 151 Patton Ave. > Asheville, NC 28801-5001 > [EMAIL PROTECTED] <mike.duncan%40noaa.gov> > 828.271.4289 > > jch92592 wrote: > > > > > > All, > > > > I am using an ArrayCollection that I populate with the results from a > > ColdFusion RPC. > > > > All works well when there is more than 1 record. When only 1 record is > > returned, the data is not assigned to the ArrayCollection. > > > > Any suggestions? > > > > Thank you, > > jh > > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFJHIiSnvIkv6fg9hYRAlGzAKCIblu06TZ3RwHX0CJg8QqRZrRIXACffhUh > DnnU2NWQAOl6jhcSwp03gMk= > =G5aj > -----END PGP SIGNATURE----- > > > -- Fotis Chatzinikos, Ph.D. Founder, Phinnovation [EMAIL PROTECTED],