Ticket #7052 (closed defect: fixed)

Opened 12 months ago

Last modified 12 months ago

dijit.Tooltip fails in multiple dojo page

Reported by: Ryan Smith Owned by: jburke
Priority: high Milestone: 1.2
Component: General Version: 1.1.1
Severity: normal Keywords:
Cc:

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

simple.html (2.1 kB) - added by bill 12 months ago.
7052.patch (2.7 kB) - added by jburke 12 months ago.
Possible patch to fix the issue, without using string concat in dojo._ieDispatcher

Change History

Changed 12 months ago by bill

Changed 12 months ago by jburke

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.

Changed 12 months ago by jburke

  • priority changed from normal to high
  • milestone set to 1.2

Changed 12 months ago by jburke

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

Changed 12 months ago by jburke

  • status changed from new to closed
  • resolution set to fixed

(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.