Flex ListBase scroll vertically error
March 27th, 2007
I’m working on a shopping cart where I can drag items into a List using a custom itemRenderer. Everything goes perfect until I add more items then the viewable area of the list. When I scroll vertically, both with the scrollbar and with the mousewheel, I get the #1010 ListBase:scrollVertically error and the items render above and below the list area. I’ve searched through the flexcoders mailing archive of Yahoo and on the internet but all the possible solutions I found so far don’t seem to help. I tried setting the width of the itemRenderer to a fixed width in stead of 100%, setting the rowHeight of the list component and removing the variableRowHeight=”true”. Does anyone have any idea on how to solve this error? It seems to be a Flex bug. Here is my exact error (on mouseWheel scroll): [quickcode:noclick]TypeError: Error #1010: A term is undefined and has no properties. at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::scrollVertically() at mx.controls.listClasses::ListBase/set verticalScrollPosition() at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::mouseWheelHandler() at mx.controls::List/mx.controls:List::mouseWheelHandler()[/quickcode] The error I get when I scroll with the scrollbar is as follows: [quickcode:noclick]TypeError: Error #1010: A term is undefined and has no properties. at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::scrollVertically() at mx.controls::List/mx.controls:List::scrollHandler() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.controls.scrollClasses::ScrollBar/http://www.adobe.com/2006/flex/mx/internal::dispatchScrollEvent() at mx.controls.scrollClasses::ScrollThumb/::mouseMoveHandler()[/quickcode] Any help would be appreciated greatly!
Popularity: 12% [?]




I am having the same exact problem as you. Also, if I maximize and de-maximize (not minimize) and then scroll, things work fine, I can scroll without the error.
This made me think it was datagrid redraw issue. I used datagrid.invalidateDisplayList and other options, nothing seems to work.
Let me know if you found a solution to this issue…
Hey Om,
I solved the problem by not using a List component for my application. In stead I now use a VBox (with drag and drop functionality) with a Repeater in it and within the Repeater a custom item renderer. This works just as great and I don’t have the scroll error anymore. Hope this works for you.
Apparently this bug has been fixed in the Flex 2.0.1 SDK Hotfix 1.
Bug 192558 in the list of fixes.
Bug fix list and patch download here: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb401224
This definitely isn’t fixed yet. I’m getting the same error with a datagrid.
(And I’m on 2.0.1)
Hey Om and Kev,
I still had the error and I was working with Flex 2.0.1 with the hotfix 1. So perhaps this is a slightly different error than the one described in the bugfix list of hotfix 1.
I have chosen for another approach in the mean time which seems to be working very nice. I now use a VBox with a repeater inside it which uses an itemRenderer. It does the trick quite nice after some tweaking:)
Add this function to your grid class:
override protected function updateDisplayList(w:Number, h:Number):void {
var b:Boolean = false;
if( rendererChanged ) b = true;
super.updateDisplayList(w, h);
if( b ) {
while( rowInfo.length > listItems.length ) rowInfo.pop();
}
}
Thanks Marc… that override worked beautifully!
Thanks Marc, also from me. After 4 hours searching for a solution – that override is great!
Big Thanks for this hack. Works perfectly for me!!
Thanks Marks, override worked perfectly for me too.
Thanks Marc ……..that override is Great
Thanks Marc, just saved me countless hours with this override.
Can someone please explain how to carry out the solution in post number 7 i.e Add this function to your grid class:
I am not sure what the grid class refers to.
I am experiencing problems with my datagrid whereby if I click on the scroll bar on the area behind the drag bar, the datagrid messes up and text from one row overlaps that of another. Content of the datagrid is also appearing out side the datagrid area below the datagrid.
I really need a solution of this badly!
Thanks
Paul
Yes can someone explain wat “add to grid class” means? I have a List component and the same problem is happening!
The solution worked perfectly even for DataGrids in Flex 2.0.1. Thanks a lot!!!!
Marc:
I have a problem with image distortion..(i.e.) when I scroll the datagrid, the images in each cell go haywire! I tried your solution but I get the following errors..
1120: Access of undefined property rendererChanged
1120: Access of undefined property listItems
1120: Access of undefined property rowInfo
1120: Access of undefined property rowInfo.
I have an mxml component in which I created a datagrid control and I have a tag with some methods in them to manipulate the datagrid…I included your workaround in the same script block but when I do..I get the above errors… Please help me out..
thanks,
Praneet
I m getting same error when i m trying to scroll datagrid. I have tried the above given method in my grid class:
override protected function updateDisplayList(w:Number, h:Number):void {
var b:Boolean = false;
if( rendererChanged ) b = true;
super.updateDisplayList(w, h);
if( b ) {
while( rowInfo.length > listItems.length ) rowInfo.pop();
}
}
But its giving me error that
Access of undefined property : rendererChanged
Access of undefined property : rowInfo
Access of undefined property : listItems
Can someone tell me about these properties.
Thanks in advance
-Sonali.
Great work Marc, I probably never would have figured that out
I also have the same problem,
I am using flex datagrid control and using random text and images into the column itemrenderer(using datagrid as chat window). Everything works fine before scrollbars appear.
When I scroll grid contents up and down,grid rows contents get exchanged i.e. some times top row appear in the middle, sometime it appear in the bottom.This happens with each row of the datagrid. I used the solution in post number 7, but it didn’t work for me.:(
Can someone show me the solution.
Thanks in advance.
You save my life Marc !