That ought to have done it.  You can try the following to verify the
basics, and then check to see if your copy() and/or clone() functions
have a bug.

var newUnit:UnitVO = new UnitVO( );
newUnit.someProp = someValue;
ModelLocator.currentDeal.addUnit( newUnit );


--- In [email protected], "Jonathan Willis" <[EMAIL PROTECTED]> wrote:
>
> I've got a clone( ) method in UnitVO that initializes a new instance
> of UnitVO to the values of the current instance and returns the copy.
> When I add the clone to the DataGrid, I get the same result. A row is
> added but I can't see any data. Now my code looks like this:
> 
> var newUnit:UnitVO = unitData.clone( );
> ModelLocator.currentDeal.addUnit( newUnit );
> 
> --- In [email protected], "Doug Lowder" <douglowder@> wrote:
> >
> > I think you want to call ModelLocator.currentDeal.addUnit( new UnitVO(
> > ) ) to add a new unit.  Or, you could add a clone() method to your
> > UnitVO object and make sure you either pass the clone to addUnit() or
> > have addUnit() explicitly clone the object before adding it to the
> > array.  What you have now is probably adding the same object reference
> > that you then clear out. 
> > 
> > Doug
>






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