Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A3BC911EFE for ; Wed, 21 May 2014 02:41:39 +0000 (UTC) Received: (qmail 34398 invoked by uid 500); 21 May 2014 02:41:39 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 34381 invoked by uid 500); 21 May 2014 02:41:39 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 34373 invoked by uid 99); 21 May 2014 02:41:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2014 02:41:39 +0000 Date: Wed, 21 May 2014 02:41:39 +0000 (UTC) From: "Nick Kwiatkowski (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (FLEX-34283) XML item's parent null in item renderer when added to XMLListCollection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-34283?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Nick Kwiatkowski closed FLEX-34283. ----------------------------------- Resolution: Fixed Fix Version/s: Apache Flex 4.13.0 Issue has been fixed with commit 89853fa. =20 One slight regression that does exist from < 4.11.0 however. We no longer = automatically re-parent items that are added to the collection. This is co= nsistent with with XML models. Also, the pointer (memory location) to [sou= rce] will change whenever an item is added to the list. This should't be a= n expensive operation (it's an o*n operation), but if you are watching the = source property, you may not see the changes to the data. This is to get a= round a bug in the flash player. The sample code that was attached attempts to add an item to the collection= that does not have a parent. The .copy() function that was used does not = copy the parent property, for some odd reason. So, the result will not be = the same as previous sdk versions, but it is working as it should be now. > XML item's parent null in item renderer when added to XMLListCollection > ----------------------------------------------------------------------- > > Key: FLEX-34283 > URL: https://issues.apache.org/jira/browse/FLEX-34283 > Project: Apache Flex > Issue Type: Bug > Components: Spark: List > Affects Versions: Apache Flex 4.12.0 > Reporter: Fr=C3=A9d=C3=A9ric Monjo > Assignee: Nick Kwiatkowski > Priority: Critical > Labels: collections, xml > Fix For: Apache Flex 4.13.0 > > Attachments: Tests.mxml > > > Since 4.12, there seems to be a regression bug in XMLListCollection. The = scenario is: > # The user selects an item in a list and clicks a button to create a copy= of this item below the selected one > # Clone the item through {{item.copy()}}, make some modifications to this= item > # Add the item to the XMLListCollection using {{addItemAt}}, then call {{= refresh()}} on the collection > # Inside some item renderers (not obviously the cloned one), XML item's p= arent is null, and never get updated, which could cause runtime errors. > Up to version 4.11, there has never been such problems. After a short inv= estigation, this problem may be caused by a change in {{XMLListAdapter}} fr= om [this commit|https://github.com/apache/flex-sdk/commit/59dd2be7f6a9b0fda= 745249cf979adeac7f406b7].=20 > Please find attached a sample program to reproduce the bug. Run the progr= am, select an item and click on the "Duplicate after" button.=20 > When run in 4.11, you should see the following console trace : > {code} > --- is child of ---> = > --- is child of ---> = > --- is child of ---> = > --- is child of ---> = > -------------------------------------------------- > --- is child of ---> = > --- is child of ---> = > --- is child of ---> > --- is child of ---> = > {code} > Whereas when run in 4.12, you would get : > {code} > --- is child of ---> = > --- is child of ---> = > --- is child of ---> = > --- is child of ---> = > -------------------------------------------------- > --- is child of ---> = > --- is child of ---> = > --- is child of ---> > --- is child of ---> null > {code} > Where you can see that the last item has lost his parent (note that it is= not the cloned item). You may try to clone several random items, and resul= ts get even more confusing as you clone more items : > {code} > --- is child of ---> = > --- is child of ---> = > --- is child of ---> = > --- is child of ---> = > -------------------------------------------------- > --- is child of ---> = > --- is child of ---> = > --- is child of ---> > --- is child of ---> null > -------------------------------------------------- > --- is child of ---> = > --- is child of ---> = > --- is child of ---> > --- is child of ---> > --- is child of ---> null > -------------------------------------------------- > --- is child of ---> = > --- is child of ---> = > --- is child of ---> > --- is child of ---> > --- is child of ---> null > --- is child of ---> > -------------------------------------------------- > --- is child of ---> = > --- is child of ---> = > --- is child of ---> > --- is child of ---> > --- is child of ---> null > --- is child of ---> > --- is child of ---> null > -------------------------------------------------- > --- is child of ---> = > --- is child of ---> = > --- is child of ---> > --- is child of ---> > --- is child of ---> null > --- is child of ---> > --- is child of ---> null > --- is child of ---> > -------------------------------------------------- > --- is child of ---> = > --- is child of ---> = > --- is child of ---> > --- is child of ---> > --- is child of ---> null > --- is child of ---> > --- is child of ---> null > --- is child of ---> null > --- is child of ---> null > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)