HI
I've just checked my cf tests and I've found that I've consistently cast
the data in the result method called when I've received the result from
cf.
public function getMasterQuery_Result(event:ResultEvent):void
{
projectList.dataProvider = event.result as ArrayCollection
}
Where projectList is my datagrid. Of course this could quite easily be
model.workplace.employees where employees is typed as an ArrayCollection
All of my tests have been based on examples off the adobe site, so I can
only really assume this is the way to do it.
--
Emile Swain
Senior Creative Developer
Direct: 020 7087 2754
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of lostinrecursion
Sent: 03 December 2006 16:59
To: [email protected]
Subject: [flexcoders] Simple Question - Array to ArrayCollection - Best
Practice/CFusion
Hi all,
This is a best practice question really.
I use Cairngorm for the larger apps I build. I also use Coldfusion and
the nifty class mapping that it can perform between DTOs (or VOs,
whatever you call them)
Here's the conundrum. A lot of my top level classes have
ArrayCollections of other supporting classes.
For example: Workplace class has a collection called Employees, which
very possibly could have its own set of collections called Vehicles,
all custom VO classes.
So, when i get them back from Coldfusion and they come in as an Array,
I know that in order to use them as a dataProvider, you need to cast
them as ArrayCollection.
So far, so good.
But if I just do this: {model.workplace.employees as ArrayCollection}
in the dataProvider property, sometimes I receive coercion errors if
the returning array is one element.
Bottom Line: In a Cairngorm app, where is the best place to do my
casting or conversion of arrays??