incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cframp...@apache.org
Subject svn commit: r1409473 - /incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
Date Wed, 14 Nov 2012 22:12:56 GMT
Author: cframpton
Date: Wed Nov 14 22:12:55 2012
New Revision: 1409473

URL: http://svn.apache.org/viewvc?rev=1409473&view=rev
Log:
Improve the comments I added yesterday to save().

Modified:
    incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as

Modified: incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as?rev=1409473&r1=1409472&r2=1409473&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
(original)
+++ incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridItemEditor.as
Wed Nov 14 22:12:55 2012
@@ -181,7 +181,7 @@ public class GridItemEditor extends Grou
         
         if (_data && column.dataField)
         {
-            // If complex data need to dig the data value out of the correct object.
+            // If complex field reference need to dig the data value out of the correct object.
             var dataFieldPath:Array = column.dataFieldPath;
             this.value = column.dataFieldPath.length == 1 ?
                 _data[column.dataField] :
@@ -464,12 +464,15 @@ public class GridItemEditor extends Grou
         var data:Object = data;
         var typeInfo:String = "";
                         
-        // Handle complex data field by drilling down to the correct object.
-        // Complex data fields means dataFieldPath.length > 1.
-        for (var i:int = 0; i < column.dataFieldPath.length - 1; i++)
-            data = data[column.dataFieldPath[i]];
+        // If a complex field reference need to get the parent object where the property
+        // will be updated.  It is a complex field reference if dataFieldPath.length >
1.
+        // Note that if the path is incorrect there will be a ReferenceError either here
or
+        // when accessing the invalid property below.
+        var dataFieldPath:Array = column.dataFieldPath;
+        for (var i:int = 0; i < dataFieldPath.length - 1; i++)
+            data = data[dataFieldPath[i]];
         
-        property = column.dataFieldPath[i];
+        property = dataFieldPath[i];
             
         for each(var variable:XML in describeType(data).variable)
         {



Mime
View raw message