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

Bug 436757

Summary: Disposing TabFolder does not destruct TabFolder children on Client side
Product: [RT] RAP Reporter: Arnaud MERGEY <a_mergey>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: tbuschto
Version: 2.3   
Target Milestone: 2.3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Sample code reproducing the issue
none
Very simple snippet without workbench none

Description Arnaud MERGEY CLA 2014-06-05 17:56:45 EDT
Created attachment 244020 [details]
Sample code reproducing the issue

Sometimes I add Error: TypeError: Cannot read property 'getFocusedChild' of null error on client with Combo Widget
Debugging this I noticed destruct was not called on Combo Widget on client side (even disposed was called on server side), so changeFocusedChild listener was not removed and then the error occured.

This issue is caused by TabFolder, disposing a TabFolder dispose its children on server side correctly, but does not destruct children on client side.

To reproduce the issue open updated workbench demo, 
- click on open editor action, 
- click on "click me" button
- close opened editor
- click again on "click me" button
The error  Error: TypeError: Cannot read property 'getFocusedChild' of null occurs

Code is in /org.eclipse.rap.demo/src/snippet/editor/StackEditor.java class
The Combo is a child of TabFolder.
Comment 1 Ivan Furnadjiev CLA 2014-06-06 02:25:16 EDT
Created attachment 244028 [details]
Very simple snippet without workbench

Snippet to reproduce the crash without workbench
Comment 2 Ivan Furnadjiev CLA 2014-06-06 07:34:31 EDT
Pending changes - https://git.eclipse.org/r/#/c/28108/ and https://git.eclipse.org/r/#/c/28109/.
Comment 3 Tim Buschtoens CLA 2014-06-06 09:06:10 EDT
Note that the error can also occur when only the TabItem is disposed, in which case the Combo is not supposed to be disposed (and isn't), but still becomes parentless due to the way TabFolder is implemented. That's why that other change in DropDown (https://git.eclipse.org/r/#/c/28108/) is also needed.
Comment 4 Ivan Furnadjiev CLA 2014-06-11 03:41:07 EDT
Apply the fix to 2.3-maintenance branch with changes https://git.eclipse.org/r/28115 and https://git.eclipse.org/r/28116.