Sorry I guess I wasn't clear, you absolutely can return arrays of typed
structs and have them converted for you. That's the main point of doing
this. You can return thousands of objects in arrays, and it is ridiculously
faster then creating cfcs, you do not need LCDS to do this.

I mentioned the array because in Flex if you don't have an instance of the
AddressBook object compiled into the app, it will come in as a generic
object. But if it works when you return arrays of vos that were created with
CreateObject, then that's not the problem.

Is the AddressBook.cfc in your webroot or is it under some path?

This :

[RemoteClass(alias="AddressBook")]

will only work (with this method) if AddressBook is in your webroot, if you
use CreateObject it will work without the fully qualified path, but if you
want to use this typed struct method you have to use the full path.

So if your AddressBook is actually in com.vo.AddressBook then you have to
use

struct['__type__'] = 'com.vo.AddressBook'

and

[RemoteClass(alias="com.vo.AddressBook")]

Sorry if I am making it sound more complicated then it is, but it basically
boils down to making sure your __type__ is fully qualified and matches your
alias.


On Feb 19, 2008 5:15 PM, Gareth Arch <[EMAIL PROTECTED]> wrote:

> Hmmm...not too sure what you mean by this.
>
> I had the code setup in a DAO gateway, so the <cfcomponent
> alias="AddressBook"> was in an AddressBook.cfc (the code I posted was a
> cffunction in AddressBookGateway.cfc).  In my AS class, I have
> [RemoteClass(alias="AddressBook")] to handle the class that is returned from
> CF (and convert it to the correct AddressBook class).  In the code, I'm
> trying to return an array of AddressBook objects (thus the array that I'm
> returning).  If I do a createobject for CF AddressBook objects and put it in
> an array, it correctly returns an array of AddressBook objects back to AS;
> however, if I use the __type__ and a struct of the other variables (even
> with correct camelCasing), it returns an array of generic objects.  If I try
> a returntype of AddressBook[] from CF, it states that it is not a valid
> AddressBook (which makes sense as it hasn't been converted yet).  If I can
> only return one item back to AS from CF using this method, I'll probably
> just stick with the method I was using before (as creating one object vs.
> one struct isn't going to make a big difference), but if it can send
> multiple items back as VOs, then that's what I'm looking for.  There's
> something I'm missing between the gateway and the AS.  If, as Barney states,
> it is the LiveCycle intermediary, then I'm fresh out as my company won't
> pony up for that, but if there's something else that I'm missing that can do
> the conversion via AMF, then I'm all ears :)
>
> Thanks.
> Gareth
>
> >sorry pressed send too soon. To finish that sentence :
> >
> >The only thing I see that is odd about your posted code is that you are
> >returning an array, so on the flex side you need to make sure that you
> are
> >compiling an instance of your VO into the application or you will get a
> >generic object...
> >
> >On Feb 19, 2008 1:13 PM, J
> >
> >> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299389
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to