...using CF, which can't use VO's.  We just have CF send me a strut, and the bizz-nass delegate converts it to the known VO.  The back-end gent and I use them to effectively communicate what we are passing back and forth, but there is currently no way to validate it, hehe, so no worries there.
 
 
----- Original Message -----
Sent: Wednesday, November 30, 2005 3:49 PM
Subject: Re: [flexcoders] instanceof on Object

Then ya I guess I'd recommend a clone method.... but not in each VO.
 
I think I remember (at least in Java) running into difficulty a while back when I tried to put "any" functions in a VO.  They try to serialize the functions back and forth between the server and the flash player.
 
You might be able to write single function that recursivley instantiates the class (and child classes) and copies the data from the orginal to the newly instantiated one.
 
Assuming you have the code to recursively copy properties and arrays (for (var prop in obj)) already you might be able to use this code to create the classes on the fly...
 
and since I'm sure your already calling Object.registerClass() on all your VO's you already have the className property set that you can use for instantiation.

 
On 11/30/05, JesterXL <[EMAIL PROTECTED]> wrote:
mx.utils.ObjectCopy does not do deep copies, nor work right:
 
She's got array's in her too, so that definately rules in it, and I need prototype integrity (subclass vs. superclass).
 
 
----- Original Message -----
Sent: Wednesday, November 30, 2005 2:09 PM
Subject: Re: [flexcoders] instanceof on Object

 
 


 
On 11/30/05, JesterXL <[EMAIL PROTECTED] > wrote:
...I guess I'll have to implement a clone method on all of my VO's.  Any
other solution/hack?

----- Original Message -----
From: "JesterXL" <[EMAIL PROTECTED]>
To: "Flexcoders" < flexcoders@yahoogroups.com>
Sent: Wednesday, November 30, 2005 1:40 PM
Subject: [flexcoders] instanceof on Object


I have some VO's, and I use their class type to render a form.  My Dialogue
I'm passing this VO into is bound to an object, like so:

private var formData:Object;

<mx:TextInput text="{formData.label}" />

When I call this method externally:

myDialogue.setFormData(someVO);

Function looks something like this:

function setFormData(o)
{
   for(var p in o)
   {
       formData[p] = o[p];
   }
}

My bindings work great.  However, instanceof does not.  If I do this:

formData = o;

It DOES work; naturally because it's just a reference.  However, this
dialogue works like a preferences.  As such, I need to create my own local
copy; the above for loop is actually more involved since I need a deep copy,
and thus get a true, deep copy, not a reference.

However, this in turn breaks my instanceof code.  I've tried:

formData.__proto__ = o.prototype
formData.__proto__ = o.__proto__

...none of which work.  Frankly, I really don't care formData is truly a
sub-class, I just want my instanceof to work, even if it's taked.

???





--
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 --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/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/







--
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






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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to