That error indicates a recycling problem.  Does it happen if you use the 
default renderer instead of your custom renderer?  Could your custom renderer 
be changing the name property of the renderer?  Can you reproduce it in a 
simple test case?

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of Simon Bailey
Sent: Thursday, March 12, 2009 4:46 AM
To: [email protected]
Subject: Re: [flexcoders] ListBase error


Here is the debug trace:

ypeError: Error #1010: A term is undefined and has no properties.
            at 
mx.controls.listClasses::ListBase/shiftRow()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:6975]
            at 
mx.controls.dataGridClasses::DataGridBase/shiftRow()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\dataGridClasses\DataGridBase.as:2170]
            at 
mx.controls.listClasses::ListBase/scrollVertically()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:6677]
            at 
mx.controls::DataGrid/scrollVertically()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:5098]
            at mx.controls.listClasses::ListBase/set 
verticalScrollPosition()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:1314]
            at mx.controls::DataGrid/set 
verticalScrollPosition()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:906]
            at 
mx.controls::DataGrid/scrollHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\!
 DataGrid.as:1942]
at flash.events::EventDispatcher/dispatchEventFunction()
            at flash.events::EventDispatcher/dispatchEvent()
            at 
mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
            at 
mx.controls.scrollClasses::ScrollBar/http://www.adobe.com/2006/flex/mx/internal::dispatchScrollEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\scrollClasses\ScrollBar.as:1261]
            at mx.controls.scrollCla! 
sses::ScrollThumb/mouseMoveHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\scrollClasses\ScrollThumb.as:206]

On 12 Mar 2009, at 11:35, Simon Bailey wrote:



Hi all,

Any ideas why on scroll of a datagrid the #1010 error is firing from the 
ListBase class on this line of code: rowMap[r.name].rowIndex = newIndex! ;

I have seen this problem in the past with Flex 2 and funnily enough have not 
seen it since, now its rearing its head again.  Using the below code (love the 
comments by the Adobe team)  and digging in the debugger I see that r.name 
(CustomGridRenderer3134) is not showing in list of items on the rowMap hence 
the error being thrown?

protected function shiftRow(oldIndex:int, newIndex:int, numCols:int, 
shiftItems:Boolean):void
{
    var r:IListItemRenderer;
    for (var j:int = 0; j < numCols; j++)
    {
        r = listItems[oldIndex][j];
        if (shiftItems)
        {
            listItems[newIndex][j] = r;
            rowMap[r.name].rowIndex = newIndex;
        }
        // this is sort of a hack to a! ccomodate the fact that
        // scrolling down does a splice which throws off these values.
        // probably better to call shiftRow with different parameters?
        else
            rowMap[r.name].rowIndex = oldIndex;
    }
    if (shiftItems)
        rowInfo[newIndex] = rowInfo[oldIndex];
}

Cheers, Simon



Reply via email to