You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Justin Mclean (JIRA)" <ji...@apache.org> on 2013/04/17 05:59:15 UTC

[jira] [Updated] (FLEX-17312) ListBase.value getter throws runtime error #1069 if data provider objects do not have "data" property

     [ https://issues.apache.org/jira/browse/FLEX-17312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Mclean updated FLEX-17312:
---------------------------------

    Labels: easyfix easytest  (was: )
    
> ListBase.value getter throws runtime error #1069 if data provider objects do not have "data" property
> -----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-17312
>                 URL: https://issues.apache.org/jira/browse/FLEX-17312
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: DataGrid, mx: List
>    Affects Versions: Adobe Flex SDK 3.2 (Release)
>         Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Browser: Safari
> Language Found: English
>            Reporter: Adobe JIRA
>            Priority: Minor
>              Labels: easyfix, easytest
>
> Steps to reproduce:
> 1. Populate the data provider for a List or DataGrid with objects of a sealed (non-dynamic) class without a "data" property
> 2. Select an item in the list or grid
> 3. Attempt to read the "value" property of the list or grid
>  
>  Actual Results:
> ReferenceError: Error #1069: Property data not found on [class name] and there is no default value.
>  
>  Expected Results:
>  Should not throw an error
>  
>  Workaround (if any):
>  - Add a "data" property to the class used to populate the list (or make the class dynamic), or:
>  - Subclass list or grid so that the value getter checks for "data" property before trying to read it
> I've attached two code files in Archive.zip that reproduce this.
> The problem seems to be this line of code in ListBase.get value():
> return item.data != null ? item.data : item.label;
> I'd guess it needs a check like: if (item.hasOwnProperty("data"))...

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