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

Bug 434306

Summary: [Menu] Application crashes when the preItem is clicked
Product: [RT] RAP Reporter: Wolfgang Pedot <wolfgang.pedot>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: ivan, martin
Version: 2.3   
Target Milestone: 2.3 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Animated gif showing the problem none

Description Wolfgang Pedot CLA 2014-05-07 06:40:25 EDT
Created attachment 242791 [details]
Animated gif showing the problem

When a menu is opened on the client a preItem "..." is generated and shown until the server delivers the real content of the menu. Clicking on that item (only possible with slow connection/server) causes an error:

Error: Invalid target for ServerObject, or target not in ObjectManager

  stack: Error: Invalid target for ServerObject, or target not in ObjectManager
    at Object.rwt.remote.RemoteObjectFactory.getRemoteObject (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:68303:13)
    at rwt.qx.Class.define.members.getRemoteObject (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:67025:45)
    at Object.rwt.remote.EventUtil.notifySelected (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:42806:18)
    at rwt.qx.Class.define.members._notifySelected (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:47420:30)
    at rwt.qx.Class.define.members.execute (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:47394:14)
    at rwt.qx.Class.define.members._onMouseUp (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:42478:18)
    at rwt.qx.Class.define.members._dispatchEvent (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:4230:18)
    at rwt.qx.Class.define.members.dispatchEvent (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:4171:12)
    at Object.rwt.event.EventHandler._dispatchMouseEvent (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:15946:14)
    at Object.rwt.event.EventHandler._onmouseevent_post (http://martind.finkzeit.at:8080/rwt-resources/rap-client.js:15897:12)

I think the reason for this is that even thought the preItem is disabled the click is actually processed and transfered to the server but since the preItem does not have a java-side counterpart this fails.

It is quite easy to reproduce by putting a long sleep in LifeCycleServiceHandler.processUIRequest, I am testing inside a Workbench.
My colleague made an animated gif that shows the issue on a popup menu.

Adding 

if(this.isEnabled()) {
}

around the this._notifySelected() call in MenuItem.js:execute fixes this but I have no idea what it might break...

The online-demo running on 2.2 does not show this behaviour.
Comment 1 Ivan Furnadjiev CLA 2014-05-07 11:00:47 EDT
Maybe it's better to check for enabled in MenuItem.js#execute.
Comment 2 Ivan Furnadjiev CLA 2014-05-08 09:01:23 EDT
Fixed in master with change https://git.eclipse.org/r/26149.