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

Bug 454428

Summary: Client Error using Form ImageHyperlink Widget
Product: [RT] RAP Reporter: Arnaud MERGEY <a_mergey>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 3.0   
Target Milestone: 3.0 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
snippet reproducing the bug none

Description Arnaud MERGEY CLA 2014-12-08 08:57:04 EST
Created attachment 249238 [details]
snippet reproducing the bug

Having a ImageHyperlink widget in RAP/RWT application can crash the application with client error

After doing some tests it seems, set null for text image and setEnabled to false at the same time crash client part of Hyperlink 

see attached snippet to have a simple reproducing test case

clicking on x button result is this.


Client Error

Details:

Error: Error: Operation "set" on target "w4" of type "org.eclipse.ui.forms.widgets.Hyperlink" failed:
Cannot read property 'trim' of null
Properties: 
enabled = false
text = 
image = null


  Script: {"head":{"requestCounter":3},"operations":[["set","w2",{"defaultButton":"w5"}],["set","w4",{"enabled":false,"text":"","image":null}],["listen","w5",{"FocusOut":true}]]}
  Stack: Error: Operation "set" on target "w4" of type "org.eclipse.ui.forms.widgets.Hyperlink" failed:
Cannot read property 'trim' of null
Properties: 
enabled = false
text = 
image = null

    at Object.rwt.remote.MessageProcessor._processError (http://127.0.0.1:12304/rwt-resources/rap-client.js:61689:11)
    at Object.rwt.remote.MessageProcessor.processOperationArray (http://127.0.0.1:12304/rwt-resources/rap-client.js:61530:12)
    at Object.rwt.remote.MessageProcessor.processMessage (http://127.0.0.1:12304/rwt-resources/rap-client.js:61483:12)
    at rwt.qx.Class.define.members._handleSuccess (http://127.0.0.1:12304/rwt-resources/rap-client.js:62174:19)
    at Object._success (http://127.0.0.1:12304/rwt-resources/rap-client.js:31440:43)
    at Object.rwt.remote.Request._onReadyStateChange (http://127.0.0.1:12304/rwt-resources/rap-client.js:31491:18)
    at XMLHttpRequest. (http://127.0.0.1:12304/rwt-resources/rap-client.js:624:17)
  Debug: on
  Request: {"head":{"requestCounter":2},"operations":[["set","w2",{"activeControl":"w5"}],["notify","w5","Selection",{"button":1,"shiftKey":false,"ctrlKey":false,"altKey":false}],["set","w1",{"cursorLocation":[100,20],"focusControl":"w5"}]]}
Comment 1 Ivan Furnadjiev CLA 2014-12-08 09:18:47 EST
I can reproduce it with your snippet. Investigating...
Comment 2 Ivan Furnadjiev CLA 2014-12-08 09:31:31 EST
It's related to image, but not the text. The crash is in RWTQuery.js#fixBackgroundImage with incoming null value.
Comment 3 Ivan Furnadjiev CLA 2014-12-09 02:06:44 EST
Pending change https://git.eclipse.org/r/#/c/37788/
Comment 4 Ivan Furnadjiev CLA 2014-12-10 06:08:47 EST
Fixed with change https://git.eclipse.org/r/#/c/37788/