Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Fatal error in connection with ToolTip
Fatal error in connection with ToolTip [message #1752595] Wed, 25 January 2017 14:12 Go to next message
Gunnar Adams is currently offline Gunnar AdamsFriend
Messages: 49
Registered: May 2016
Member
Hi,

I have been investigating a rather mysterious bug in our application and think, that I have found a potential error in the RAP-Client code.

In the application, we use the Tooltip widget in order to display messages to the user.
We create those tooltips as children of the main application window (a Shell) with the SWT.BALLOON style, setAutHide(false).
When such a tooltip has been displayed by our application, the destruction of the main application window on exit out of the application, will result in an error

Error: Operation "destroy" on target "w2" of type "null" failed:
objectEntry is undefined.

"w2" is the id of the Shell widget being destroyed. The object whose entry is undefined is the ToolTip widget, which has already been disposed by the application a long time before closing the Shell window.

I debugged the Javascript code and found, that the Tooltip widget is added to the destroyableChildren list of the owning Shell, but is never removed from that list when the Tooltip widget is disposed. This is due to the fact that in TooltipHandler.js the protocolParent isn't set. rwt.remote.HandlerUtil.addDestroyableChild(parent, result) is called, though. removeDestroyableChild is never called, because protocolParent is null.

For some reason, for the normal Tooltip behavior displaying hints on/for another widget does not add the ToolTip to the destroyableChildren list.

The following fix to ToolTipHandler.js seems to work fine:

rwt.remote.HandlerRegistry.add( "rwt.widgets.ToolTip", {

factory : function( properties ) {
var styleMap = rwt.remote.HandlerUtil.createStyleMap( properties.style );
var style = null;
if( styleMap.ICON_ERROR ) {
style = "error";
} else if( styleMap.ICON_WARNING ) {
style = "warning";
} else if( styleMap.ICON_INFORMATION ) {
style = "information";
}
var result = new rwt.widgets.ToolTip( style );
result.setMarkupEnabled( properties.markupEnabled === true );
rwt.remote.HandlerUtil.addStatesForStyles( result, properties.style );
rwt.remote.HandlerUtil.callWithTarget( properties.parent, function( parent ) {
rwt.remote.HandlerUtil.addDestroyableChild( parent, result );
result.setUserData("protocolParent", parent);
} );
return result;
},



Question: is this a bug in RAP or is my usage of the ToolTip widget in this way illegal?

Kind regards,
Gunnar Adams

[Updated on: Wed, 25 January 2017 14:15]

Report message to a moderator

Re: Fatal error in connection with ToolTip [message #1752596 is a reply to message #1752595] Wed, 25 January 2017 14:28 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
thanks for reporting this. I think this is a bug in the JS client and your solution is the correct fix. Please file a bugzilla about this issue and we will fix it.
Regards,
Ivan
Re: Fatal error in connection with ToolTip [message #1752603 is a reply to message #1752596] Wed, 25 January 2017 15:11 Go to previous message
Gunnar Adams is currently offline Gunnar AdamsFriend
Messages: 49
Registered: May 2016
Member
Thank you very much.

I have created the bugzilla report

https://bugs.eclipse.org/bugs/show_bug.cgi?id=511037

Kind regards,
Gunnar

[Updated on: Wed, 25 January 2017 15:11]

Report message to a moderator

Previous Topic:Monitoring RAP application with New Relic
Next Topic:[SOLVED] How-to ? URL formatting with deeplink and parameters
Goto Forum:
  


Current Time: Thu Apr 25 09:43:15 GMT 2024

Powered by FUDForum. Page generated in 0.03069 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top