Factum Vicesimus Quartus

Exploring web x.0, innovation and RIA techniques

Add to Google





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/https://www.adobe.com/2006/flex/mx/internal::dispatchScrollEvent() at mx.controls.scrollClasses::ScrollThumb/::mouseMoveHandler()[/quickcode] Any help would be appreciated greatly!


23 Responses to "Flex ListBase scroll vertically error"
  1. # 1   Om
    April 25th, 2007 at 02:40

    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…

  2. # 2   Wietse Veenstra
    April 26th, 2007 at 20:41

    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.

  3. # 3   Om
    May 4th, 2007 at 03:20

    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

  4. # 4   Kev W
    May 17th, 2007 at 05:10

    This definitely isn’t fixed yet. I’m getting the same error with a datagrid.

  5. # 5   Kev W
    May 17th, 2007 at 05:11

    (And I’m on 2.0.1)

  6. # 6   Wietse Veenstra
    May 17th, 2007 at 08:51

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

  7. # 7   Marc Sulinski
    July 11th, 2007 at 14:01

    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();
    }
    }

  8. # 8   Ryan
    September 27th, 2007 at 21:49

    Thanks Marc… that override worked beautifully!

  9. # 9   Reto
    October 26th, 2007 at 23:19

    Thanks Marc, also from me. After 4 hours searching for a solution – that override is great!

  10. # 10   ObiJanKenobi
    November 13th, 2007 at 10:18

    Big Thanks for this hack. Works perfectly for me!!

  11. # 11   Addie
    November 27th, 2007 at 10:51

    Thanks Marks, override worked perfectly for me too.

  12. # 12   Li
    December 28th, 2007 at 04:53

    Thanks Marc ……..that override is Great

  13. # 13   Hristo
    February 28th, 2008 at 21:13

    Thanks Marc, just saved me countless hours with this override.

  14. # 14   Paul
    March 11th, 2008 at 17:13

    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

  15. # 15   Johto
    March 12th, 2008 at 18:33

    Yes can someone explain wat “add to grid class” means? I have a List component and the same problem is happening!

  16. # 16   cuk
    April 17th, 2008 at 22:56

    The solution worked perfectly even for DataGrids in Flex 2.0.1. Thanks a lot!!!!

  17. # 17   Praneet
    October 23rd, 2008 at 21:30

    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

  18. # 18   Sonali
    January 6th, 2009 at 07:54

    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.

  19. # 19   Justin
    January 23rd, 2009 at 07:08

    Great work Marc, I probably never would have figured that out

  20. # 20   Raj
    January 30th, 2009 at 14:11

    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.

  21. # 21   Mika
    March 5th, 2009 at 01:29

    You save my life Marc !

  22. # 22   Gaston
    August 27th, 2010 at 18:41

    I have a datagrid inside an HBox component. I´m using the Adobe Datagrid class. Can I override that method?

    Thanks

  23. # 23   Andriy
    April 27th, 2011 at 19:53

    Adobe livedocs (on Flex 3) say you should call List::validateNow() function after you have changed items in dataprovider to make instant effect.
    This is not so curvy, as overriding classes…

Leave a Reply