On Oct 16, 2007, at 10:34 AM, stephen50232 wrote:

But I keep getting error messages telling me that e.result does not
have a property called Firstname (or any of the other fields returned
by the query in the CFC).

And that's correct if the result is returned as an ArrayCollection. An ArrayCollection is a collection of objects with properties. Your UserVO might be the first item in that collection - but it's not the collection itself.

So, calling something like e.result.Firstname is going to be null and will throw an error. Firstname might be a property of the first item in the array collection, but it's not a property of the collection itself.

I know my result is returned as a ArrayCollection, but how can I bind
that to a Value Object, which I'll then add to my model object so it
is available through out my application.

You have to parse out the element from your returned collection.

If the first item in the ArrayCollection can be cast to your UserVO, then do just that.

var collection:ArrayCollection = e.result as ArrayCollection;

then....

appModel.user = collection.getItemAt(0) as UserVO;

or....

appModel.user = new UserVO( collection.getItemAt(0) );


I think you just have to understand that you can't convert an ArrayCollection to a single object. It's a collection of objects in an ArrayCollection.

good luck.

jon

Reply via email to