Whenever you want help diagnosing a thrown exception, use a debug build and 
post the entire stack trace with the linenumbers.

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Adrian 
Williams
Sent: Wednesday, November 19, 2008 1:04 PM
To: [email protected]
Subject: [flexcoders] Alex et al, Could this be a bug in the 
AdvancedDataGridBaseEx? WAS-> Strange ADG error on deleting entire nodes at 
once...


Ok, I have spent the morning pouring through the debugging trying to figure out 
what this error is and am completely stymied. I have been able to determine it 
has nothing to do with my delete functions...the code never makes it to them 
anyway...I suspect it may be a bug in the core AdvancedDataGridBaseEx code. The 
actions that are being done are:

1.) A user drags a grouped node off the 6-column ADG to the trash can image on 
the app control bar...

            <mx:Image source="{trashImage}" right="80" buttonMode="true" 
toolTip="drag a subgroup here to delete them from the project" 
dragDrop="deleteSubgroupDrop(event)" dragEnter="deleteSubgroupEnter(event)" 
id="image2"/>

2.) my drag manager is listening and accepts the dragEnter:

            private function deleteSubgroupEnter(evt:DragEvent):void
            {
                var obj:IUIComponent = IUIComponent(evt.currentTarget);
                DragManager.acceptDragDrop(obj);
            }

2.)  and then accepts the dragDrop. On the drop, I am throwing an alert box up 
to confirm that the user wants to do this:

          private function deleteSubgroupDrop(event:DragEvent):void
            {
                partsToDelete = new Array;
                partsToDelete = currentSubgroups.selectedItems;
                subgroupToRemove = currentSubgroups.selectedItem.GroupLabel;
                alert.confirm("Are you sure you want to delete this subgroup: 
'" + subgroupToRemove +
                 "' from the project?? This cannot be reversed!!", 
deleteSubgroupAction);
            }

3.)  When it hits the alert box, the code then jumps into the core to render 
the alert box. The code eventually ends up in the LayoutManager.as code on line 
592, function validateDisplayList():void.

4.)  The logic steps thru all of the objects that are on the stage and for each 
of them calls the obj.validateDisplayList(); function. All goes well until it 
gets to my ADG. Via the validate leg, it goes to the ADGBaseEx.as code to the 
function commitEditedItemPosition(coord:Object):void. During the course of this 
function, the columnIndex is manhandled all over the place.  Eventually, it 
gets to line 4406 where it is checking:

    if(colIndex > lockedColumnCount)

    and passes this check, stepping to the next line of

    if (colIndex < horizontalScrollPosition + lockedColumnCount)

    which fails, then executing a loop against the colIndex.  Once the loop is 
completed, the final line

    actualColIndex = 
absoluteToVisibleColumnIndex(displayToAbsoluteColumnIndex(colIndex));

    is called, which is on line 7164 of the AdvancedDataGridBaseEx.as code.  
Within this function is a single method:

    return displayableColumns[columnIndex].colNum;

    As I stepped thru the code, I watched the values.  columnIndex == 6 and on 
the execution of this line, the error is thrown.  When I hover the mouse over 
the components of the line, I get tooltips on "displayableColumns (Array 
displayableColumns - mx.controls.AdvancedDataGridBaseEx) and over [columnIndex] 
(columnIndex = 6).  However, when I hover over the .colNum...I get nothing.  In 
this case, the error is:

    TypeError: Error #1010: A term is undefined and has no properties.

    I am really hoping that someone, especially Alex or the like, can provide 
some insight to what the heck is happening here because I really, really need 
to get past this error.

Best,
Adrian

oneworld95 wrote:

What does your delete method look like? Try adding some IF statements
to check for null or undefined values before you run the delete. If
it's null or undefined, do a return.

--- In [email protected]<mailto:flexcoders%40yahoogroups.com>, Adrian 
Williams <[EMAIL PROTECTED]> wrote:
>
> All,
>
> I could really use some help in identifying where even to begin
> looking to figure out what's causing this problem.
>
> I have a ADG that is displaying a GroupingCollection.
>
> I have an application control bar that has a "trash" image. A user
> can drag a node from the ADG and drop it in the trash to delete the
node
> and all it's children.
>
> When you initially get into the application and drag the first node
> of the tree to the trash, the delete fires correctly and without error.
>
> When you try to drag the (now) first node of the tree into the
> trash, I get the following error:
>
> TypeError: Error #1010: A term is undefined and has no properties.
> at
>
mx.controls::AdvancedDataGridBaseEx/displayToAbsoluteColumnIndex()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:7166]
> at
>
mx.controls::AdvancedDataGridBaseEx/commitEditedItemPosition()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:4426]
> at
>
mx.controls::AdvancedDataGridBaseEx/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:1807]
> at
>
mx.controls::AdvancedDataGrid/updateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\AdvancedDataGrid.as:5924]
> at
>
mx.controls.listClasses::AdvancedListBase/validateDisplayList()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\controls\listClasses\AdvancedListBase.as:3071]
> at
>
mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602]
> at
>
mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:675]
> at Function/http://adobe.com/AS3/2006/builtin::apply()
> at
>
mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460]
> at
>
mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403]
>
> This only errors when manipulating the second time you try to
delete
> the first node. You can delete any of the other nodes, repeatedly,
> without error. I suspect there is some kind of out of index problem
> happening but the dump gives me no ideas on where to look.
>
> Anyone?!
>
> Thanks,
> Adrian
>

Reply via email to