Title: Message

You’ll need to make your own copy of the object, AS is always pass by reference.

 

You can try calling mx.utils.ObjectCopy.copy(yourobj) and it may give you back a copy with what you want.

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Griffin
Sent: Saturday, April 22, 2006 3:50 PM
To: [email protected]
Subject: [flexcoders] Flex 1.5 - getrepeaterItem values

 

I have a small app which passes the reference to a repeater item to an editable view.  I have been trying to assign the values from the original repeater dataProvider item into a new array that can then be edited without affecting the original data until explicitly saved.  The problem is that every combination I've tried is still updating the repeater data so I'm pretty sure I'm just assigning references instead of copying the values over.  A simplified version of the code follows:

//positionVO has an array of names called Successors

var editablePosition:positionVO;

 

//currentPosition is the repeater item that got clicked in the main UI

  function setEditableDetails(currentPosition)
  {
   
    editablePosition.Successors = currentPosition.getRepeaterItem().Successors;
    

    //also tried creating editablePosition variable as a new positionVO

    //editSuccessorsList should now be able to have items added to it without adding them to the original currentPosition data as well

    //with this code the repeater view is still bound to editSuccessorList's dataProvider new items are added to both lists

   

    editSuccessorsList.dataProvider = editablePosition.Successors;
  

    }   

If anyone can advise on what I'm doing wrong in the previous example a nudge in the right direction would be appreciated. 

 

Many thanks in advance.

 

Mike




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





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.4/320 - Release Date: 4/20/2006

Reply via email to