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 77C6C110E1 for ; Sun, 13 Apr 2014 03:46:19 +0000 (UTC) Received: (qmail 35879 invoked by uid 500); 13 Apr 2014 03:46:19 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 35866 invoked by uid 500); 13 Apr 2014 03:46:16 -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 35858 invoked by uid 99); 13 Apr 2014 03:46:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Apr 2014 03:46:16 +0000 Date: Sun, 13 Apr 2014 03:46:16 +0000 (UTC) From: "Justin Mclean (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (FLEX-34218) Binding error in DataGridColumn MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-34218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13967724#comment-13967724 ] Justin Mclean edited comment on FLEX-34218 at 4/13/14 3:44 AM: --------------------------------------------------------------- The item renderer in above (few lines removed for clarity) is: {code} package { [Bindable] public class Item { private var itemValues:ArrayCollection; public function get count():int { return itemValues.length; } } } {code} So the RTE is nothing to do with either binding or code in the ADG but the fact that itemValues is null in the item renderer. There are several way this could be worked around in the user code: 1. Initialise itemValues with new ArrayCollection(); 2. Change the getter to return 0 if itemValues is null Question is should the ADG be catching user errors and hiding them (which could be inside any user lass/code depending on what the item renderer is doing or using) as it did previously or report them when they occur as it does now in 4.12? Putting the try catch back in does incur a significant memory/CG/performance hit was (Author: jmclean): The item renderer in above (few lines removed for clarity) is: package { [Bindable] public class Item { //this property is null private var itemValues:ArrayCollection; public function get count():int { //this throw TypeError return itemValues.length; } } } So the RTE is nothing to do with either binding or code in the ADG but the fact that itemValues is null in the item renderer. There are several way this could be worked around in the user code: 1. Initialise itemValues with new ArrayCollection(); 2. Change the getter to return 0 if itemValues is null Question is should the ADG be catching user errors and hiding them (which could be inside any user lass/code depending on what the item renderer is doing or using) as it did previously or report them when they occur as it does now in 4.12? Putting the try catch back in does incur a significant memory/CG/performance hit > Binding error in DataGridColumn > ------------------------------- > > Key: FLEX-34218 > URL: https://issues.apache.org/jira/browse/FLEX-34218 > Project: Apache Flex > Issue Type: Bug > Components: Data Binding, mx: DataGrid > Affects Versions: Apache Flex 4.12.0 > Environment: Windows 7 64bits > Reporter: Fernando Hernandez > Assignee: Justin Mclean > Labels: DataGridColumn > Original Estimate: 8h > Remaining Estimate: 8h > > The mx:DataGridColumn launch exception when dataField property is used with any getter function that can be throw a TypeError. The errors aren't catched as expected in mx:DataGridColumn#itemToLabel() function. The spark GridColumn still ignores errors. > > Existing applications may break. > In Flex 4.12 you remove the try catch for mx:DataGridColumn#itemToLabel() for data[datafield] in this changeset: https://fisheye6.atlassian.com/changelog/flex-sdk?cs=9f8aab8675dc3288be9b1b906da64b5c91728d70 > StackTrace > TypeError: Error #1009: Cannot access a property or method of a null object reference. > at Item/get count()[C:\desarrollo\workspaces\fluid\flexbuilder7-workspace\asdf\src\Item.as:16] > at mx.controls.dataGridClasses::DataGridColumn/itemToLabel()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridColumn.as:1749] > at mx.controls.dataGridClasses::DataGridBase/makeListData()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridBase.as:1493] > at mx.controls::DataGrid/http://www.adobe.com/2006/flex/mx/internal::setupRendererFromData()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/mx/src/mx/controls/DataGrid.as:2013] > at mx.controls::DataGrid/commitProperties()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/mx/src/mx/controls/DataGrid.as:1968] > at mx.core::UIComponent/validateProperties()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/core/UIComponent.as:8751] > at mx.managers::LayoutManager/validateProperties()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/LayoutManager.as:605] > at mx.managers::LayoutManager/doPhasedInstantiation()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/LayoutManager.as:821] > at mx.managers::LayoutManager/doPhasedInstantiationCallback()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1188] -- This message was sent by Atlassian JIRA (v6.2#6252)