Opened 14 years ago

Closed 14 years ago

#5845 closed defect (fixed)

GFX Silverlight MouseLeave event always generates script error

Reported by: Adam Peller Owned by: Eugene Lazutkin
Priority: high Milestone: 1.2
Component: DojoX GFX Version: 1.0
Keywords: Cc:
Blocked By: Blocking:


I'm using the Dojo GFX engine to draw a representation of a connected graph and have set a mouse handler to generate MouseEnter? and MouseLeave? events so that the object under the mouse can be highlighted. Typical example code:

var group=surface.createGroup(); group.connect("onmouseenter",this,"handleOver"); group.connect("onmouseleave",this,"handleOut");

The handleOver and handleOut methods perform the highlighting. The mouse enter event gets fired correctly, however the mouse leave event always generates the following JavaScript? error:

"Trying to get unsupported property on scriptable plugin object!"

On doing some investigation, I believe this originates from the mouseFix function in the Silverlight.js file. For mouse leave events the failing line is line 637 where the value of a.ctrl is being read. On checking the Silverlight documentation, it states that the mouse leave event should generate a null eventArgs object (the a object in a.ctrl), however the mouseFix routine has already checked for null, so it looks like the eventArgs object is not null, but doesn't contain what the function is expecting.

Change History (3)

comment:1 Changed 14 years ago by Eugene Lazutkin

Milestone: 1.1.1
Status: newassigned

comment:2 Changed 14 years ago by guest

I have surrounded the code with try catch

var mouseFix = function(s, a){
	var ev = {target: s, currentTarget: s, 
		preventDefault: function(){}, stopPropagation: function(){}};
		try {
			ev.ctrlKey = a.ctrl;
			ev.shiftKey = a.shift;
			var p = a.getPosition(null);
			ev.x = ev.offsetX = ev.layerX = p.x;
			ev.y = ev.offsetY = ev.layerY = p.y;
			// calculate clientX and clientY
			var parent = surfaces[s.getHost()];
			var t = dojo._abs(parent);
			ev.clientX = t.x + p.x;
			ev.clientY = t.y + p.y;				
		} catch (e) {
	return ev;

comment:3 Changed 14 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [14179]) gfx.silverlight: fixes #5845. !strict

Note: See TracTickets for help on using tickets.