Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing an ArrayCollection from ColdFusion to Flex (with BlazeDS)

When pushing objects from ColdFusion to Flex via BlazeDS, and mapping the classes using RemoteClass...

[RemoteClass(alias="blah.blah")]

...is it possible to have ColdFusion "Arrays" (or some Java equivalent) automatically mapped to ActionScript ArrayCollections?

This chap nearly had it, but not quite:

http://www.richinternet.de/blog/index.cfm?mode=entry&entry=33CF66A4-DC95-6312-95EFE8E3DB31D298

like image 965
stubotnik Avatar asked Jul 28 '09 09:07

stubotnik


2 Answers

For what it's worth, a ColdFusion Query object maps directly and automatically to an ArrayCollection. So if it's an option, you could manually create a query object and return that from your service.

like image 192
Adam Tuttle Avatar answered Oct 19 '22 18:10

Adam Tuttle


After upgrading to CF 9.0.1 & BlazeDS 4, I finally have an answer to this.

You can now use the following node in you services-config.xml

<serialize-array-to-arraycollection>true</serialize-array-to-arraycollection>

Details here: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS5B9C73A8-5FA2-4a54-B0C6-CECA2E20052D.html

like image 25
stubotnik Avatar answered Oct 19 '22 19:10

stubotnik