You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Maxime Cowez (JIRA)" <ji...@apache.org> on 2013/01/22 18:34:13 UTC

[jira] [Commented] (FLEX-33248) Spark GridItemEditor cannot edit nested properties

    [ https://issues.apache.org/jira/browse/FLEX-33248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559791#comment-13559791 ] 

Maxime Cowez commented on FLEX-33248:
-------------------------------------

[~cframpton] I tried the patched GridItemEditor that came with v4.9.0, but it doesn't work for me.

The root of the problem comes from this line at the end of the 'save()' method:
dataGrid.dataProvider.itemUpdated(data, property, oldData, newData);

In my patch the value of  'data' was the main value object and the value of  'property' was 'someProperty.nestedProperty' (following the example in the description of the bug).
In the changes you made to that patch, the value of 'data' became 'someProperty' and the value of  'property' became 'nestedProperty'.

This causes the following issue:
Assuming the DataGrid's dataprovider is an ArrayCollection, when that call to 'itemUpdated()' is made, the code execution will eventually pass through 'ListCollectionView#addItemsToView()'. 
In this method we find the following line: if (filterFunction == null || filterFunction(item))
The problem occurs when 'filterFunction' is defined. Because 'item' is now 'someProperty' and not the main value object, you'll get a Type Coercion error.
The code execution stops there, but I'm pretty sure that even without a 'filterFunction' there will be other issues further down the road.

I hope I'm making myself sufficiently clear. I'll try to come up with test application.

BTW: what is the standard JIRA procedure here? I mean: who is supposed to close or reopen the issue? Do I do that, or does a committer decide what's the best action?
                
> Spark GridItemEditor cannot edit nested properties
> --------------------------------------------------
>
>                 Key: FLEX-33248
>                 URL: https://issues.apache.org/jira/browse/FLEX-33248
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: DataGrid
>    Affects Versions: Apache Flex 4.8 (parity release)
>            Reporter: Maxime Cowez
>            Assignee: Carol Frampton
>            Priority: Minor
>             Fix For: Apache Flex Next
>
>         Attachments: Company.as, Employee.as, FLEX33248.mxml, GridItemEditor.as
>
>
> To reproduce:
>     <s:DataGrid editable="true">
>         <s:columns>
>             <s:ArrayList>
>                 <s:GridColumn dataField="someProperty.nestedProperty" />
>             </s:ArrayList>
>         </s:columns>
>     </s:DataGrid>
> This will throw a "no such property" error when the user tries to edit a cell, because GridItemEditor tries to access `_data[column.dataField]` in the `data` setter.  
> I filed it as a bug and not as an improvement, because it is inconsistent with `GridItemRenderer`'s behaviour, which does render the nested property correctly.
> Note that the `save()` method is also affected: the item's property is accessed in the same way there.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira