EnsureVisible trashing Flex 4.5.1 mx:DataGrid

Bug reports.
svella
Posts: 3
Joined: Wed Mar 07, 2012 8:13 pm

EnsureVisible trashing Flex 4.5.1 mx:DataGrid

Post by svella » Wed Mar 07, 2012 9:15 pm

Automation is calling Click(Position) on a cell in a Flex 4.5.1 mx:DataGrid control, which results in EnsureVisible being called, which in turn sets an invalid value for horizontalScrollPosition on the DataGrid control, resulting in the DataGrid being in an unrecoverable inconsistant state where subsequent mouse click result in the debug Flash Player error dialog popping up with the following stack trace:

Code: Select all

TypeError: Error #1010: A term is undefined and has no properties.
	at mx.controls::DataGrid/mouseDownHandler()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\DataGrid.as:4787]
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]
I was able to catch the setting of the bad value of horizontalScrollPostion by setting a conditional breakpoint in flex debugger:
EnsureVisible1.png
EnsureVisible1.png (191.43 KiB) Viewed 1744 times
Note that the cell in question was already completely visible (third row, 2nd column), the datagrid in question only has 2 columns, and that the units for horizontalScrollPosition in a flex datagrid is columns, not pixels, so a value of 9 as shown in the debugger is clearly an error.

I've also attached snapshots showing the variable values of two frames above the offending call in case that helps track down the problem:
EnsureVisible2.png
EnsureVisible2.png (101.11 KiB) Viewed 1744 times
EnsureVisible3.png
EnsureVisible3.png (58.16 KiB) Viewed 1744 times
Other factors that may be important:
  • The Datagrid in question is an inline subclassed component of Datagrid, and the column in question has both a custom itemrenderer and itemeditor
  • At the time of the click the itemeditor is active and the click was actually on a combobox child of the itemeditor
Last edited by svella on Wed Mar 07, 2012 9:34 pm, edited 1 time in total.

svella
Posts: 3
Joined: Wed Mar 07, 2012 8:13 pm

Re: EnsureVisible trashin Flex 4.5.1 mx:DataGrid

Post by svella » Wed Mar 07, 2012 9:18 pm

EnsureVisible4.png
Screen shot of datagrid in question - click is on the combobox that says "false"
EnsureVisible4.png (26.92 KiB) Viewed 1742 times

svella
Posts: 3
Joined: Wed Mar 07, 2012 8:13 pm

Re: EnsureVisible trashin Flex 4.5.1 mx:DataGrid

Post by svella » Wed Mar 07, 2012 9:26 pm

Snapshot - Note that because editor closes when it loses focus I was unable to snapshot with itemeditor active so itemrender is there instead. Path to cell within the snapshot is:

/dom[@domain='charlie3.identitymgmt.net']/body/flexobject/container[2]/container[@id='main_window']/container[@type='ViewStack']/container[5]/container/container/element[@type='Box']/element/container/container/container[@id='rightPane']/container[@type='VDividedBox']/table/row[@index='2']/cell[2]
Attachments
EnsureVisible.rxsnp
Ranorex Spy Snapshot
(228.1 KiB) Downloaded 178 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: EnsureVisible trashing Flex 4.5.1 mx:DataGrid

Post by Support Team » Mon Mar 12, 2012 12:50 pm

Hi,

Many thanks for the detailed description of your error. We were able to locate the issue and we will fix it with the next Ranorex release. Meanwhile we could provide you a new Ranorex Preloader with the fix inside, if you want. It looks like that Ranorex uses the wrong ensure visible method for the old Flex3 Datagrid.

Regards,
Peter
Ranorex Team
.
Image