History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-15568
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: C C
Assignee: Robert Vollmar (Adobe)
Reporter: Carlos Molina
Votes: 12
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Flex SDK

If there are locked columns, DG is editable, and part of the last column is showing, infinite loop occurs when giving focus to the last column.

Created: 05/14/08 02:47 PM   Updated: 04/09/09 08:51 AM
Component/s: mx: DataGrid
Security Level: Public (All JIRA Users )

File Attachments: 1. Text File DataGrid.as (181 kb)
2. Text File DataGrid15568.patch.txt (2 kb)
3. File datagridtest.mxml (4 kb)

Issue Links:
Cloners
This issue is cloned by:
FLEXDMV-2080 If there are locked columns, ADG is e... C New
 

Severity: Crash/Hang
Reproducibility: Every Time
Discoverability: Medium
Found in Version: SDK Flex 3 (Released)
Milestone: SDK Flex 3.3.0 and SDK Flex 3.0.2
Affected OS(s): Windows - All Windows
Steps to Reproduce:
Attached is a simple app that will demonstrate the issue

Steps to reproduce with example:

When you run the example, there should be a horizontal scrollbar at the bottom of the table.
Click on a cell in the middle of the table.
Press the tab key to advance to the next cell.
When you get to a point where you are tabbing to a cell that requires the horizontal scrollbar to shift, the infinite loop occurs.
If the bug were not present, you should be able to continue tabbing to the end of the row and then continue tabbing through cells in the next row.


I believe I have discovered a fix for this issue within the Flex DataGrid.as file, however, it is in a private method.

I was able to try out the fix by creating copies of DataGrid.as, DataGridItemRenderer.as and DataGridHeader.as, giving them new names and updating references.

Here is the proposed fix in DataGrid.as. It is in the scrollToEditedItem method:



<original code>

:

    while (colIndex > lastColIndex ||

          (colIndex == lastColIndex && colIndex > horizontalScrollPosition + lockedColumnCount &&

           partialCol))

    {

        if (horizontalScrollPosition == maxHorizontalScrollPosition)

            break;

        horizontalScrollPosition = Math.min(horizontalScrollPosition + (colIndex > lastColIndex ? colIndex - lastColIndex : partialCol), maxHorizontalScrollPosition);

        len = (listItems && listItems[0]) ? listItems[0].length : visibleColumns.length;

        lastColIndex = horizontalScrollPosition + len - 1 + lockedColumnCount;

        partialCol = (listItems[0][len - 1].x + listItems[0][len - 1].width > listContent.width) ? 1 : 0;

    }

:





<code with fix>

:

   var horzScrollPos:Number = horizontalScrollPosition;

   while (colIndex > lastColIndex ||

         (colIndex == lastColIndex && colIndex > horizontalScrollPosition + lockedColumnCount &&

          partialCol))

   {

       if (horzScrollPos == maxHorizontalScrollPosition)

           break;

       horzScrollPos = Math.min(horzScrollPos + (colIndex > lastColIndex ? colIndex - lastColIndex : partialCol), maxHorizontalScrollPosition);

       len = (listItems && listItems[0]) ? listItems[0].length : visibleColumns.length;

       lastColIndex = horzScrollPos + len - 1 + lockedColumnCount;

       partialCol = (listItems[0][len - 1].x + listItems[0][len - 1].width > listContent.width) ? 1 : 0;

   }

   horizontalScrollPosition = horzScrollPos;

 
 
 
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: No
QA Owner: Robert Vollmar (Adobe)
Resolved by: Alex Harui
Participants: Alex Harui, Carlos Molina, Deepa Subramaniam, Glenn Jones and Robert Vollmar (Adobe)
Browser: Internet Explorer 7.x


 All   Comments      Sort Order:
Robert Vollmar (Adobe) - [05/19/08 02:33 PM ]
Able to reproduce in 3.0.1 and gumbo-fp10 revision 1782. Changing the summary. The problem is that when there are locked columns and part of the last column is visible, tabbing to the last column (or cliking on it) will cause an infinite loop and eventually the RTE below. Note that it works ok if all of the last column is showing before trying to give it focus.

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at mx.core::UITextField/set ignorePadding()
at mx.controls.dataGridClasses::DataGridItemRenderer()
at mx.core::ClassFactory/newInstance()
at mx.core::ContextualClassFactory/newInstance()
at mx.controls.dataGridClasses::DataGridBase/createColumnItemRenderer()
at mx.controls.dataGridClasses::DataGridHeader/updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.managers::LayoutManager/validateClient()
at mx.core::UIComponent/validateNow()
at mx.controls::DataGrid/set horizontalScrollPosition()
at mx.controls::DataGrid/scrollToEditedItem()
at mx.controls::DataGrid/commitEditedItemPosition()
at mx.controls::DataGrid/updateDisplayList()
at mx.controls.listClasses::ListBase/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()


Robert Vollmar (Adobe) - [06/24/08 07:34 PM ]
Fix for 3.0.x

Deepa Subramaniam - [08/25/08 05:11 PM ]
SDK Community candidate (I will email Carlos to submit a patch, since he basically did so in the bug description) and if not fixed, to Ryan for Gumbo release.

Deepa Subramaniam - [08/25/08 05:21 PM ]
Carlos, can you submt a patch for this since you've alredy done the hard-work of diagnosing the issue? You'll need to submit a Contributor's Agreement.

Deepa Subramaniam - [10/09/08 01:25 PM ]
Under Investigation for 3.0.2.

Glenn Jones - [01/13/09 03:28 PM ]
Patch for DataGrid.as from 3.2.0.3958 svn tag

Glenn Jones - [01/13/09 03:32 PM ]
FYI - I reproduced this problem in the 3.2.0.3958 build. I applied to a fix to that build which resolved the issue. The attached a patch (DataGrid15568.patch.txt) contains that fix - it's basically the same as the fix described in the problem description.

Alex Harui - [01/27/09 02:42 PM ]
svn 4682

Rejected patch as it did not address all cases. Actual issue was in calculation of column sizes when a column was forced below its minWidth. The difference in calculations used by scrollToEditedItem and calculateColumnSizes prevented the horizontalScrollPosition from advancing enough to end the loop. scrollToEditedItem would try to advance it and calculateColumnSizes would put it back.

Robert Vollmar (Adobe) - [01/27/09 05:15 PM ]
Confirmed fixed in 3.3.0.4689. I will hold off on closing this until 3.3.0 changes have been migrated to trunk, and I have verified it fixed in trunk.

Robert Vollmar (Adobe) - [02/02/09 05:34 PM ]
Confirmed fixed in trunk rev. 4801. (The merged from 3.3 occured with checkin 4787.)