Vertically scrolling an AdvancedDataGrid with custom ItemRenderers results in corruption

I've logged a jira item about this ...
http://bugs.adobe.com/jira/browse/FLEXDMV-2667
It's probably a good idea to throw it open to the forum as well to see if anyone has encountered this before.
In short, I have an AdvancedDataGrid with custom ItemRenderers on each of the columns that are responsible for rendering the cell data. If the ADG is resized so that it's not all visible, and the scrollbar is scrolled all the way up and all the way down a couple of times, and the ADG is then resized again so that all the rows are visible, there's something very wrong with the result. Basically it looks as though extra rows are being drawn behind the existing ones, all on top of one another, resulting in a corrupted display.
I've actually gotten it to reproduce itself every time, if you check out the jira item above for executable code and follow the instructions you should see it, and there's a screenshot of the result as well.
As I detail in the jira commentary, it's definately something to do with the renderers. As the scroll bar is moved up and down extra renderers are consantly being created, and old ones don't seem to be GC'd at any point, and furthermore seem to be drawn onscreen even when they're not being used to explicitly draw the cells of the ADG. If this -is- the case then there's a memory leak here as well.

Throwing the code inline to make it easier to try out ...
ADGItemRendererIssue.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
               creationPolicy="all"
               creationComplete="init()">
    <s:layout>
        <s:BasicLayout/>
    </s:layout>
    <fx:Script>
        <![CDATA[
            import ADGIssue.*;
            import mx.collections.*;
            import mx.controls.*;
            import mx.controls.advancedDataGridClasses.*;
            import mx.core.IFactory;
            import mx.events.AdvancedDataGridEvent;
            import mx.events.ListEvent;
            import spark.components.supportClasses.ItemRenderer;
            [Bindable]
            public var expenses:ArrayCollection = new ArrayCollection([
                {Expense:"Taxes", Amount:100, Cost:80, Discount:20},
                {Expense:"Rent", Amount:200, Cost:90, Discount:21},
                {Expense:"Bills", Amount:300, Cost:100, Discount:22},
                {Expense:"Books", Amount:400, Cost:110, Discount:23},
                {Expense:"Food", Amount:500, Cost:120, Discount:24},
                {Expense:"Goldfish", Amount:600, Cost:130, Discount:25}
            public var cache:Dictionary = new Dictionary(true);
            protected function init():void
                var grp:AdvancedDataGridColumnGroup = new AdvancedDataGridColumnGroup();
                grp.headerText = "Expenses";
                grp.dataField = "Expense";
                grid.groupedColumns = new Array();
                grid.groupedColumns.push(grp);
                grp = new AdvancedDataGridColumnGroup();
                grp.headerText = "Finances";
                grp.children = new Array();
                var col:AdvancedDataGridColumn = new AdvancedDataGridColumn();
                col.headerText = "Amount";
                col.dataField = "Amount";
                col.itemRenderer = new ADGIssueItemRendererFactory("Amount");
                grp.children.push(col);
                col = new AdvancedDataGridColumn();
                col.headerText = "Cost";
                col.dataField = "Cost";
                col.itemRenderer = new ADGIssueItemRendererFactory("Cost");
                grp.children.push(col);
                col = new AdvancedDataGridColumn();
                col.headerText = "Discount";
                col.dataField = "Discount";
                col.itemRenderer = new ADGIssueItemRendererFactory("Discount");
                grp.children.push(col);
                grid.groupedColumns.push(grp);
                grid.dataProvider = expenses;
        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:VDividedBox x="35" y="29" width="80%" height="600">
        <mx:AdvancedDataGrid  height="400" id="grid" designViewDataType="flat"  width="100%"/>
        <s:TextArea text="just some text to take up a wee bit of space" width="100%"/>
    </mx:VDividedBox>
</s:Application>
ADGIssueItemRendererFactory.as (in package ADGIssue)
package ADGIssue
    import flash.utils.Dictionary;
    import mx.core.IFactory;
    public class ADGIssueItemRendererFactory implements IFactory
        private var _label:String;
        public function ADGIssueItemRendererFactory(label:String)
            trace("Creating Factory for: "+label);
            _label = label;
        public function newInstance():*
            return new ADGIssueItemRenderer(_label);
ADGIssueItemRenderer.as (also in package ADGIssue)
package ADGIssue
    import components.*;
    import mx.controls.Label;
    import mx.controls.listClasses.*;
    import mx.core.*;
    import mx.logging.ILogger;
    import mx.logging.Log;
    import mx.logging.LogEventLevel;       
    public class ADGIssueItemRenderer extends Label implements IDataRenderer
        private var _label:String;
        private var countvalue = 0;
        private static var count:int = 0;
        public function ADGIssueItemRenderer(label:String)
            trace("Creating Renderer for: "+label+" with count: "+count);
            _label = label;
            this.countvalue = count;
            count ++;
        override public function set data(rowData:Object):void
            if (rowData)
                this.text = countvalue+":"+rowData[_label];
                trace("RENDERING: "+this.text);
run the MXML and follow the instructions in the JIRA item ...
1. resize the ADG so that not all of the ADG is visible vertically, and the verticle scrollbar is shown. In the example attached the ADG is in a split panel, so the split bar can be dragged up to conceal some of the rows and display the scrollbar.
2.  drag the scroll thumb all the way to the top of the scrollbar, and all the way to the bottom and back to the top several times.
3.  Resize the ADG again so that all the rows are visible.
and the corruption should be clear to see. Here's a screenshot of what it looks like:
Anyone ever seen anything similar ? And if so, any workarounds or fixes ?

Similar Messages

  • Help with a vertical scroll bar issue with a List component

    hi. i have a basic <s:list> that uses an XMLListCollection as it's data provider and a very basic itemrenderer. when a row in the list is clicked a function gets the list.selectedIndex then populates some text fields with more xml data. that all works fine.. the problem i have is that the vertical scroll bar on the list seems to be "clickable" - just like a row in the list. the scroll bar scrolls normally but when it's clicked the selectedIndex becomes -1 which is not helpful b/c the value -1 is passed to the XMLListCollection.
    any ideas? cheers.

    thanks but still problematic...surely the <s:List> component shouldn't return a value when the scrollbar thumb is clicked? i created a very basic list (see below) and made the list dimensions short enough so that there is a vertical scrollbar and found that when the scrollbar thumb is clicked the trace(event.currentTarget.selectedIndex) returns a number. that's annoying b/c i just want a selectedIndex value for a row that is clicked not the scrollbar.
    any ideas to get around? cheers
    <fx:Script>
    <![CDATA[
    protected function list1_clickHandler(event:MouseEvent):void
    trace(event.currentTarget.selectedIndex);
    ]]>
    </fx:Script>
    <s:List x="162" click="list1_clickHandler(event)" y="276" labelField="@label" width="144" height="153">
    <s:dataProvider>
    <s:XMLListCollection>
    <fx:XMLList xmlns="">
    <node label="one"/>
    <node label="two"/>
    <node label="three"/>
    <node label="four"/>
    <node label="five"/>
    <node label="six"/>
    <node label="seven"/>
    <node label="eight"/>
    <node label="nine"/>
    <node label="ten"/>
    <node label="eleven"/>
    </fx:XMLList>
    </s:XMLListCollection>
    </s:dataProvider>
    </s:List>

  • Why are vertical scroll bars disapearing with safari

    I have no vertical scroll bar when I access certain websites through safari, but they are there if I use firefox...

    Open the Finder.
    From the Finder menu bar click Go > Go to Folder
    Type or copy / paste:    ~/LIbrary/Caches/com.apple.Safari
    Click Go the move the ApplicationCache.db (or Cache.db) file from the com.apple.Safari folder to the Trash.
    Quit and relaunch Safari to test.

  • Vertical scroll bar in table control with wizrads

    Hi,
      Im working on a table control with a customised table. I created a table control with wizards. But vertical scroll bar is not working. How can i invoke vertical scroll bar and can any one provide the code for the all the operations on a table control like save,find,find next,change....Thanks in advance.
    Avinash

    Hi Avinash
    move the records number of your internal table into field LINES of tablecontrol. So you should change the code generated by wizard in PBO, for example create a new module:
    PROCESS PBO
    MODULE SET_DATA_TO_T_CTRL.
    LOOP..
    ENDLOOP.
    MODULE SET_DATA_TO_T_CTRL.
       DESCRIBE TABLE ITAB LINE SY-TABIX.
       <TABLECONTROL>-LINES = SY-TABIX.
    ENDMODULE.
    Max

  • Often, with 4 or 5 windows open, maybe 20 tabs total, firefox stutters when vertical scrolling pages.

    Often, with 4 or 5 windows open, maybe 20 tabs total, firefox stutters when vertical scrolling pages. A restart fixes it.
    I can often work all day with many more tabs than 20 open with no issues. So I'm pretty sure the issue is not a lack of system resources.
    This last time I've noticed it, it is after waking my Macbook Air from sleep.

    Hello,
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!
    Thank you.

  • Vertical scrolling with TrackPoint's middle button won't work on MS Word

    Question:
    I have a T42 ThinkPad and the vertical scrolling with TrackPoint's middle button won't work on MS Word and therefore not in my email either. Big pain in butt as I'm so used to using it. Are there any patches that fix that? Any ideas on why it won't work?

    It's really weird. My suggestion would be that you install the most up-to-date driver by direct downloading or via System Update (if you haven't updated the driver).
    Rockwill
    ThinkPad T61p 6459A12

  • Why is scrolling not working with multiple youtube embeds layed out vertically in a stack on one page?

    Why is scrolling not working with multiple youtube embeds layed out in a stack on one page?

    Hi ,  
      This is a sort of performance issue , because your program takes more than the max time set for the program to execute in foreground.
    There are many stuff in program which will hamper your performance.
    I will list down a few
    1. SELECT *
    FROM konp
    INTO CORRESPONDING FIELDS OF TABLE konp_itab
    FOR ALL ENTRIES IN a363_itab
    WHERE knumh EQ a363_itab-knumh
    in this statement you are using for all entries a363_itab , but before this statement you are not checking if the table has any entry or not , please do remember that for all entries has this characterstic , that if you internal table does not contain any record , then all the records are selected from the database table. So in this case if you table a363_itab is empty , so what you want is no data must be seelcted from table konp , but what will happen is all the records in KONP will be seelcted.
    2. While retreiving data you are using seelct * even though you do not require all the fields , an example is
    <b>SELECT *
    FROM mkpf
    INTO CORRESPONDING FIELDS OF TABLE mkpf_itab
    FOR ALL ENTRIES IN mseg_itab
    WHERE mblnr EQ mseg_itab-mblnr.</b>
    in this your internal table contains only 2 fields
    <b>mblnr LIKE mkpf-mblnr, "Number of Material Document
    bldat LIKE mkpf-bldat, "Document Date in Document</b> , but to get these 2 fields you are selecting all the fields of the table.
    3. In select you are using into corresponding fields of table , it is not a good practice., so please avoidd it.
    Please understand that you must try to reduce the access to your database tables and try to keep it minimal , because this same thing may happen becasue data in DEV is very less compared to the volume of data in production , so a program working in DEV will take much more time in PRD if not written properly and may result in timeouts , as in your case.
    Please try to make chanegs to the prorgam and see if it works.
    In case you have more queries , please do revert back.
    Regards
    Arun
    *Reward points if replay is helpful

  • Problem with Vertical scroll in table control

    Dear All,
    I am facing a problem with table control in module pool program. currently it displays 6 lines, but it does not display the vertical scroll button, even though when I fill data in the six rows and hit enter.
    I have set the vertical scroll option on the table control properties also.
    Can someone help me by sending some sample code?
    Thanks,
    Amit Goyal

    HI Amit ,
        If you have already selected the properties of vertical and horizontal scroll bar then no other operations needed .. if the number of rows increases then that of the table control , you will automatically see the Vertical scroll in your table control ..
      if still you dont see it then write back ..
    Reward if helpful !
    Thanks
    Ranjita

  • Printing AdvanceddataGrid with itemrenderers

    Hi,
         I'm using AdvanceddataGrid in my project. Where in i have used the itemrenderers to add images in the AdvanceddataGrid. I need to have the printing functionality for this project. For that i have added a Print button. Whenever the user presses the Print button, i'm printing the AdvanceddataGrid. My problem in printing is, flex ignores the images that i have added through the itemrenderer in the Advanceddatagrid.
         It would be great if someone helps me to print the advanceddatagrid along with the itemrenderers.

    Hi Arun,
    If you can send me a sample code which reproduces your problem it may be helpful...
    Thanks,
    Bhasker Chari.S

  • Data missing on vertical scroll with Advanced Data Grid

    Hi All,
    I have a n issue as stated below.
    AdvanceDataGrid with simple rows of text values.
    On vertical scroll and move upwards, the some of the values at the top goes blank intermittently.
    Have used itemRenderer to populate the values to that particluar column.
    To fix this issue, I have tried the fixes as below but its not working:
    1) super.data=value.
    2) Used validate.now().
    Can you please give me a solution to this?
    Thanks,
    IRK.

    Hi All,
    Setting the width explicitly, solved my issue.
    grpName.width = 120;
    Thanks,
    IRK

  • AdvancedDataGrid with multiple custom sort functions

    I have an AdvancedDataGrid with several levels of nested data in which each level needs to have a custom sort.
    Ex:
    A
         Z
              C
              D
              A
         Y
              C
              D
              A
         X
              C
              D
              A
    B
         Z
              C
              D
              A
    etc...
    Is this possible without a massive sort function that takes every possible combination into account? Better yet, I'm already sorting it in SQL - can I disable the automatic sort and just have it spit out the data in the order XML passes it to ActionScript?
    Thanks

    Thanks for the tip, but unfortunately that's not what I'm looking for. I'm not trying to remove the end users' ability to sort, I'm trying to disable the automatic alphabetic sort that the ArrayCollection/AdvancedDataGrid does when it first renders the table. I know it can be overridden by using the "compareFunction" callback, but the compareFunction only iterates through the rows once, and I effectively need something that will iterate through 3 times - one for each nesting level.
    The cookbook suggests concatenating the fields and then applying the sorting logic, but that works best if you're applying the same sort to every level of nesting. In my case, it means a massive function along the lines of:
    switch(concat_fields1) {
         case 'AZC':
              switch(concat_fields2) {
                   case 'AZD':
                        return 1;
                        break;
                   default:
                        return -1;
                        break;
              break;
         case 'AZD':
              etc.
    So far, that's the only solution I've found.

  • Slow performance with custom comparator (AdvancedDataGrid sorting)

    I'm using Flex 3.4.
    I have an advancedDataGrid. Have 2 columns with numbers as data.
    For one column, I do not set any custom comparator function.
    For the other column, I set a custom comparator function which is exactly the same as the default one used by Flex. (The private function SortField.numericCompare).
    For both columns, I set the same data - 3000 Rows with values either 0 or 1.
    When i sort on column1 (the one with custom comparator), the sorting is much slower than on column2 (default Flex comparator).
    I went through the AdvancedDataGrid/SortField source codes but could not see why this could be happening as the comparator functions are the same in both cases.
    Also, I checked out this bug -
    http://bugs.adobe.com/jira/browse/SDK-13118
    But shouldn't this be applicable to both custom and default sorting?
    Can anyone help me out?

    This is the function that i have : (same as the SortField numericCompare function which is the default function which is used if no customCompare is specified.)
            public function numCompare(a:Object, b:Object):int {
                var fa:Number;
                try {
                    fa = _name == null ? Number(a) : Number(a[_name]);
                } catch (error:Error) {
                var fb:Number;
                try {
                    fb = _name == null ? Number(b) : Number(b[_name]);
                } catch (error:Error) {
                return ObjectUtil.numericCompare(fa, fb);
    As per bug, the performance should be slow for lots of items that have same value. But, it should be the same for both the custom compare and the default compare as the custom compare function I'm using is the same as what is used for Flex.

  • How to extend the WebUI product search results with customer attributes

    Hello,
    We are using CRM 7.0. We want to extend the WebUI product (Object) searches with customer attributes and to display customer attributes in the search results. We found the note 1026956 that explains how to extend the WebUI product (Object) searches with customer attributes. We want to know if there is also some note that explains how to display customer attributes in the search results for products/Objects.
    Thanks in advance,
    Sergey Kozyrev

    Sergey,
    I doubt whether there exists such note. The note 1026956 which you mentioned is for enhancing the Search for Custom attributes. For Enhancing the Result list you need to do custom development.
    Regards,
    Harshit

  • Why is there a vertical scroll bar with short page export from FW CS4?

    When I view my exported page that is 400 pixels tall, I see a vertical scroll bar on the right of my IE7 browser even though the page is no where near the bottom of the browser.  How do I eliminate that scroll bar?

    Unfortunately this is not working in IE7.  Below is my body tag (I edited the SLICES.XTT to prevent the margins) where I've added the overflow option:
    body </style>
    But I still see the vertical scroll bar with a 400 px image exported as html, see attachments.

  • Electronic noise is emitted from my computer when manually dragging the vertical scroll bar with hardware accleration enabled, but no noise is emitted when scrolling any other way (ie hyperscroll via mouse wheel).

    [Firefox 4.0]
    When I use my mouse button to hold and drag the vertical scrolling bar, my computer emits a soft grainy sound. However, when I hyper scroll with my mouse wheel, there is no noise.
    I do not get the quiet noise with Internet Explorer. I did not get this with previous versions of Firefox.
    Turning hardware acceleration off resolved this.
    I'm running Windows 7 with a dedicated graphics card (GTX 285).

    Quote
    amd 64=12a @12V
    ati 9800=7.5~10.5a @12V (assuming 90~125 watts) a max load,
    a 9600 ir nvida 5200 used far less power
    so your already at 18a with no fan,s no hd, no cd,no dvd ,no mobo chipset , no mem, no sound..etc
    If you exclude the motherboard, memory, etc like you did there, the amd 64 draws 7.2A @ 12V.
    90~125W for an ATI 9800?! [irony]Are you working for a PSU manufacturer or what?[/irony] That's just absurd.  
    Go read this post to get a feel for the actual power consumption: https://forum-en.msi.com/index.php?postid=297061&sid=#post297061

Maybe you are looking for