Benoit, both of those approaches are Flex 2.0 only.

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Benoit 
Hediard
Sent: Sunday, November 20, 2005 6:56 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Returning Object Instances from ColdFusion

I think that you should use the Flex Metada RemoteClass in your AS class:
[RemoteClass(alias="CFIDE.samples.usermanager.components.User")]
public class User
{
...
}

But apparently, it is not yet supported in current alpha release...

So for the moment, you have to use "registerClassAlias" :
public function User()
{
        registerClassAlias("CFIDE.samples.usermanager.components.user",
User);          
}

Be carefull, you might get coersion failed error, due to some lazy class 
initialization.
So, as a workaround, you need to define a static var to instantiate the class 
in your remoting responser.
private static var DEP_LINK:User = new User();

For more information on this problem:
http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=584&;
threadid=1069666

Benoit Hediard


-----Message d'origine-----
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] De la part de Renaun 
Erickson Envoyé : dimanche 20 novembre 2005 07:34 À : 
flexcoders@yahoogroups.com Objet : [flexcoders] Re: Returning Object Instances 
from ColdFusion

I have not tried the code, but from what I read it seems that all you would 
need to do is put the line of code below in the begining of your app.  Like in 
the "initialize" event of the main mxml file.

mx.utils.ClassUtil.FLEX_CLASS_FIELD = "_REMOTECLASS";

Renaun

--- In flexcoders@yahoogroups.com, "Simeon Bateman" <[EMAIL PROTECTED]>
wrote:
>
> Thanks for your response. I guess my real question is where am I 
> supposed to set hte FLEX_CLASS_FIELD at?  Just in my VO in as?  Its 
> just not clear to me.
> 
> Thanks.
> simeon
> 
> --- In flexcoders@yahoogroups.com, "Renaun Erickson" <[EMAIL PROTECTED]>
wrote:
> >
> > mx.utils.ClassUtil.FLEX_CLASS_FIELD is a static field.  And the 
> > value is "_remoteClass" the article is pointing out that you need to 
> > set it to "_REMOTECLASS" because of how coldfusion sends back 
> > properties (in all uppercase).  So like the article notes your AS 
> > Objects will have to have all UPPER class attribute names.
> > 
> > Renaun
> > 
> > --- In flexcoders@yahoogroups.com, "Simeon Bateman" 
> > <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > Hey i am working on returning custom objects from coldfusion to my 
> > > flex application.  I found a good example of this here
> > > 
> > >
> >
>
http://www.richinternet.de/blog/index.cfm?mode=entry&entry=74BA931D-C3DA-FDE
0-C7959146205942DA
> > > 
> > > However in the notes at the bottom it says:
> > > 
> > > Edit: if you want to return CFC instances rather than structs then 
> > > you'll have to change the static property FLEX_CLASS_FIELD of the 
> > > mx.utils.ClassUtil class to "_REMOTECLASS".
> > > 
> > > But I cant figure out where/how to make this change?  I have 
> > > googled and searched the docs, and I cant find any examples of 
> > > using this
> class.
> > > 
> > > Thanks for any guidance i can get here.
> > > 
> > > simeon
> > >
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> Fair 
play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/u8TY5A/tzNLAA/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 --------------------~--> Get 
fast access to your favorite Yahoo! Groups. Make Yahoo! your home page 
http://us.click.yahoo.com/dpRU5A/wUILAA/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 --------------------~--> 
AIDS in India: A "lurking bomb." Click and help stop AIDS now.
http://us.click.yahoo.com/VpTY2A/lzNLAA/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