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

Bug 395272

Summary: [ClientScripting] ClientListener and disposed Widgets
Product: [RT] RAP Reporter: Stefan Milchram <stefan.milchram>
Component: IncubatorAssignee: Project Inbox <rap.incubator-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: tbuschto
Version: 2.0   
Target Milestone: 2.1 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Snippet-plugin none

Description Stefan Milchram CLA 2012-11-28 08:00:49 EST
We have the following situation:

1. Request from client to server is sent
2. During the request processing a text-widget is created
3. This text-widget gets a ClientListener attached
4. Due to the customization-concepts of our framework is can happen that this new text-widget (which was not yet sent to the client) is disposed.
5. During the disposing of this text-widget the bindings in the ClientListener are marked as disposed to.
6. In the ClientScriptRenderer.render - method disposed bindings will cause a destroy-call rendered in the response
7. The Response is sent
8. Exception on the client because the destroy-call posted in ClientScriptRenderer.render fails

So ClientListener-destroy calls should only be posted in the response if the listener is attached to an object that was already created at the client.
Comment 1 Stefan Milchram CLA 2012-11-28 08:01:30 EST
Created attachment 224050 [details]
Snippet-plugin
Comment 2 Tim Buschtoens CLA 2012-12-19 04:25:17 EST
We should get this fixed when updating the ClientScripting to RAP 2.0 RemoteObject API.
Comment 3 Ralf Sternberg CLA 2013-03-13 10:30:25 EDT
The problem is that widgets (that use an LCA) are not rendered if they are created and disposed in the same request. However, object that use the Remote API (RemoteObject) are always rendered. In case of a ClientListener attached to a Text that is disposed in the same request, the widget is not rendered, but the client listener binding is.

The solution is to skip the rendering of remote objects that are created and disposed in the same request. We might reconsider this fix once LCAs use the Remote API as well.

Fixed in RAP with commit 9c72a18602bf234e9e1569adf995ffd665fc4ed8.