Tom,

How can you have missed everything ColdFusion team has been speaking about all 
this time? 
ColdFusion Extensions can make your life a lot easier (believe me). Generate 
those files and you'll see what must implement, but basically 
1) in your AS :
[RemoteClass(alias="mypath.to.my.cfcomponent.thiscaseReactorTomssql")] 
2) your CFC (VO in CF side):
        Have a alias attribute in your component tag with the dot path notation 
like " mypath.to.my.cfcomponent.thiscaseReactorTomssql"
        Have <cfproperty tags for each attribute and with same order like in 
your AS file

With this, if you return an array of any CF component, that will be translated 
to an ArrayCollection of your AS Value Object, so, no more castings.

In case you plan to use FDS, hasOne and hasMany properties inside your CFC 
component should be defined
Company/employees (hasMany)/address(hasOne) example:
In your company component
        <cfproperty name="employees" type="path.to.the.employees.component[]"/>
        <cfset this.employees = arraynew(1)/>
        
        <cfproperty name="address" type="path.to.the.address.component"/>
        <cfset this.address = structnew()/>


João Fernandes
Dep. Informática - Área de Desenvolvimento
Cofina media

Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL
Tel (+351) 213 185 200 . Fax (+351) 213 540 370
[EMAIL PROTECTED]

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tom 
Chiverton
Sent: quarta-feira, 5 de Julho de 2006 9:32
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Array of object types returned from remote objects

On Tuesday 04 July 2006 17:02, João Fernandes wrote:
> Tom if you want to avoid casting all away in your flex app you can 
> follow the "new" rules for mapping cfcs & AS. Instead of returning an 
> array of struts, return an array of components with <cfproperty /> 
> define in them (very same order or it won't work). Better, right click 
> on your AS file and use the CF extensions to generate your cfc.
>
> 1) bind your AS class to your cfc generated object

You mean the ActionScript value object ? I'm guessing there is some 
square-bracket compiler hint I need in the class ?

> 2) in your remote function call define returntype="mypath.to.my.cfc[]" 
> <--- return type of array of mypath.to.my.cfc (don't know if it's 
> mandatory)

That would be the returnType of the CFC method being called ?

> generate your AS & CFC based on your table

*Ahh* :-)
Choosing 'wizard' and then 'CFC' gives you the option to make ActionScript 
classes too. That's a big help.

Wish me luck :-)

--
Tom Chiverton

****************************************************

This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



------------------------ Yahoo! Groups Sponsor --------------------~--> Great 
things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to