Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345692 - Javascript error while DnD between two trees
Summary: Javascript error while DnD between two trees
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Windows 7
: P2 normal (vote)
Target Milestone: 1.4 RC2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 03:46 EDT by Sabine Neubauer CLA
Modified: 2011-05-31 08:40 EDT (History)
1 user (show)

See Also:


Attachments
JavaScript test case (3.02 KB, patch)
2011-05-16 11:59 EDT, Ivan Furnadjiev CLA
no flags Details | Diff
Proposed fix (4.16 KB, patch)
2011-05-17 05:47 EDT, Ivan Furnadjiev CLA
tbuschto: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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