Opened 11 years ago

Closed 11 years ago

#7052 closed defect (fixed)

dijit.Tooltip fails in multiple dojo page

Reported by: Ryan Smith Owned by: James Burke
Priority: high Milestone: 1.2
Component: General Version: 1.1.1
Keywords: Cc:
Blocked By: Blocking:

Description

We have moved to Dojo 1.1.1 and are using the new scopeMap to support multiple dojos in the page, as described here:

http://dojotoolkit.org/book/book-dojo/part-3-javascript-programming-dojo-and-dijit/multiple-versions-dojo-page

Even after moving to a scoped dojo 1.1.1, using a second dojo with version 1.0.2 or 1.1.1 with the Tooltip still causes the same error.

The page loads, and the Tooltips work, but if we click anywhere we get an " 'undefined' is null or not an object.

The problem is the registering of events on the tooltip in the portlet dojo is impacting the scoped dojo's ie listeners

array indices. The scoped dojo._getIeDispatcher function has two handlers ( var h) registered, and the listeners array

(var ls) contains indices into the handlers. Without the portlet the ls [] = {1,0}. Add the portlet to the page, and

ls[i]={1.6};

Thus the call h[ls[i]] will call h[6], which is not defined because h has length 2.

I've attached a sample html test case to reproduce the problem. I didn't include the two dojos due to file size, but I can if requested. They are just the built versions from the community source project.

Attachments (2)

simple.html (2.1 KB) - added by bill 11 years ago.
7052.patch (2.7 KB) - added by James Burke 11 years ago.
Possible patch to fix the issue, without using string concat in dojo._ieDispatcher

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by bill

Attachment: simple.html added

comment:1 Changed 11 years ago by James Burke

Traced the problem to the IE event code in dojo._base.event. It is grabbing a globally visible object, a DOM node, or in this particular case, dijit._base.focus adds a mousedown event to the document. Then, asking for a source[method]._listeners.

Both versions of Dojo access this array. I am attaching a patch that seems to fix the issue, but I want to confirm with sjmiles before committing.

comment:2 Changed 11 years ago by James Burke

Milestone: 1.2
Priority: normalhigh

Changed 11 years ago by James Burke

Attachment: 7052.patch added

Possible patch to fix the issue, without using string concat in dojo._ieDispatcher

comment:3 Changed 11 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [14198]) Fixes #7052. the _listeners array was effectively a public, global value. Making it unique per dojo._scopeName. Reviewed change with sjmiles. Tested on IE 6. \!strict

Note: See TracTickets for help on using tickets.