Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345692

Summary: Javascript error while DnD between two trees
Product: [RT] RAP Reporter: Sabine Neubauer <neubauer>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: ruediger.herrmann
Version: 1.4   
Target Milestone: 1.4 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
JavaScript test case
none
Proposed fix tbuschto: review+

Description Sabine Neubauer CLA 2011-05-13 03:46:51 EDT
Build Identifier: 1.4M7

The following error often occurs while dragging a tree item between two trees. 

Javascript error occurred:
'null' ist Null oder kein Objekt

I can reproduce the problem with Control Demo using IE8 (32 or 64bit) but not with Firefox 3.6 on Windows 7 64bit with RAP 1.4 M7.


Reproducible: Sometimes

Steps to Reproduce:
1. start control demo and select Drag & Drop Tab
2. select tree as drag and as drop source
3. drag a tree item and move the mouse from the one tree to the other, back again, over the target tree items, ...
=> after some time (sometimes it occurs immediately, sometimes not) the Js error is diplayed
Comment 1 Ivan Furnadjiev CLA 2011-05-13 03:51:22 EDT
I can reproduce it with Controls Demo/IE9 too.
Comment 2 Ivan Furnadjiev CLA 2011-05-16 11:59:47 EDT
Created attachment 195752 [details]
JavaScript test case

This is a test case to reproduce the problem.
Comment 3 Ivan Furnadjiev CLA 2011-05-17 05:47:17 EDT
Created attachment 195826 [details]
Proposed fix

After debugging together with Tim, we found two problems in DNDSupport.js:
1. The order of mouse events ( out, move, over ) differs between browsers, which leads to wrong _currentTargetWidget. We fixed this by ensuring the correct _currentTargetWidget in DNDSupport#_dragOutHandler.
2. DNDSupport#_getCurrentFeedbackTarget returns wrong result in case of fast move over another tree or table. Fixed in DNDSupport#_getCurrentFeedbackTarget by checking if _currentDropTarget contains _currentTargetWidget.
JS test from the previous patch is included too.
Comment 4 Tim Buschtoens CLA 2011-05-18 04:35:31 EDT
Comment on attachment 195826 [details]
Proposed fix

Solution is good, one line is indented too much i think.
Comment 5 Ivan Furnadjiev CLA 2011-05-18 04:48:19 EDT
Applied patch to CVS HEAD and v14_Maintenance.
Comment 6 Sabine Neubauer CLA 2011-05-31 08:40:10 EDT
Today I have updated to RAP 1.4 RC2. The bug fix solves this issue. All works fine in Control Demo and in our own application.
=> bug fix verfied with 1.4 RC2