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

Bug 427968

Summary: [TabFolder] Crashes when disposing and readding a TabItem
Product: [RT] RAP Reporter: Christian Hager <christian.hager>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.2   
Target Milestone: 2.3 M2   
Hardware: PC   
OS: Windows 8   
Whiteboard:
Attachments:
Description Flags
Demo to reproduce the Bug none

Description Christian Hager CLA 2014-02-12 04:09:14 EST
Created attachment 239852 [details]
Demo to reproduce the Bug

The TabFolder crashes when a previously disposed TabItem is readded reusing the contents of the original TabItem. Doing the same with the CTabFolder everything works just fine.

I added a Sample-App to reproduce this behaviour. 

Steps to reproduce:
1. Toggle the Tab using the Button to remove the second TabItem
2. Toggleing the Tab again will make the TabItem reappear but not it's contents
3. Now switching back and forth between the Tabs creates the following error

Error: Error: Operation "set" on target "w9" of type "rwt.widgets.Composite" failed:
Cannot set property 'left' of null
Properties: 
bounds = 1,34,1908,400
visibility = true
clientArea = 0,0,1908,400


  Script: {"head":{"requestCounter":5},"operations":[["set","w6",{"visibility":false}],["set","w9",{"bounds":[1,34,1908,400],"visibility":true,"clientArea":[0,0,1908,400]}],["set","w10",{"bounds":[0,0,1908,400],"visibility":true}]]}
  Stack: Error: Operation "set" on target "w9" of type "rwt.widgets.Composite" failed:
Cannot set property 'left' of null
Properties: 
bounds = 1,34,1908,400
visibility = true
clientArea = 0,0,1908,400

    at Object.rwt.remote.MessageProcessor._processError (http://127.0.0.1:10080/rwt-resources/rap-client.js:229:3817)
    at Object.rwt.remote.MessageProcessor.processOperationArray (http://127.0.0.1:10080/rwt-resources/rap-client.js:229:928)
    at Object.rwt.remote.MessageProcessor.processMessage (http://127.0.0.1:10080/rwt-resources/rap-client.js:229:223)
    at rwt.qx.Class.define.members._handleSuccess (http://127.0.0.1:10080/rwt-resources/rap-client.js:233:3550)
    at Object._success (http://127.0.0.1:10080/rwt-resources/rap-client.js:97:1012)
    at Object.rwt.remote.Request._onReadyStateChange (http://127.0.0.1:10080/rwt-resources/rap-client.js:97:1902)
    at XMLHttpRequest.d (http://127.0.0.1:10080/rwt-resources/rap-client.js:14:522)
  Debug: off
  Request: {"head":{"requestCounter":4},"operations":[["set","w4",{"selection":"w19"}],["notify","w4","Selection",{"item":"w19","shiftKey":false,"ctrlKey":false,"altKey":false}],["set","w1",{"cursorLocation":[82,58]}]]}
  Phase: 5


I Tested using RAP 2.2 as well as todays Nightly-Build. Both behave the same way. If I use the CTabFolder instead everything works fine.
Comment 1 Ivan Furnadjiev CLA 2014-02-12 04:32:42 EST
I can reproduce the issue with your snippet.
Comment 2 Ivan Furnadjiev CLA 2014-02-12 11:11:06 EST
Fixed with change https://git.eclipse.org/r/21876