[Dojo-interest] 0.2.2 bug in Tooltip or dojo.widget.Widget.create
Bob Remeika
Bob.Remeika at avenuea-razorfish.com
Wed Apr 5 13:16:35 MDT 2006
Unfortunately no... however, as I am building my application, I will
probably add a feature like that for our own personal use... in which
case I will be sure to submit it to the community.
________________________________
From: dojo-interest-bounces at dojotoolkit.org
[mailto:dojo-interest-bounces at dojotoolkit.org] On Behalf Of Zoltan
Luspai
Sent: Wednesday, April 05, 2006 11:32 AM
To: dojo-interest at dojotoolkit.org
Subject: Re: [Dojo-interest] 0.2.2 bug in Tooltip or
dojo.widget.Widget.create
Hi,
Does it mean that a tooltip can belong to multiple elements? Because I
would support that feature strongly.
Regards,
Zoltan
Bob Remeika wrote:
When I create a tooltip from script and I want to use a noderef instead
of an element ID to initialize the connectNode, I have to modify the
code in dojo.widget.html.Tooltip.fillInTemplate slightly to accomplish
this task. See code below:
fillInTemplate: function(args, frag){
if(this.caption != "undefined"){
this.domNode.appendChild(document.createTextNode(this.caption));
}
dojo.html.body().appendChild(this.domNode);
// Added by Bob Remeika in case a tooltip needs
to be created using code
// and you want to use a noderef instead of an
element ID.
if (this.connectNode == null){
this.connectNode =
dojo.byId(this.connectId);
}
// IE bug workaround
this.bgIframe = new
dojo.html.BackgroundIframe();
}
After I did this I kept getting recursion errors that would keep me from
completing my task. I traced the error back to
dojo.widget.Widget.create. The problem is that this function tries to
execute this.postInitialize which is not defined by the tooltip.
Tooltip descends from Widget which might be wrong. Instead if it
descends from DomWidget then I think this problem goes away; however, I
have not tested this. This can also be classified as a bug caused by
dojo.widget.Widget.create because it does not check to see if the
functions it executes are defined by the object it is executing them on
before it tries to execute them.
I have fixed this code by simply adding postInitialize to
dojo.widget.html.Tooltip, but maybe dojo.widget.Widget.create should
still check for the functions definitions it tries to execute before it
actually executes them in case an implementation does not choose to
implement the entire DomWidget interface or wants to descend from an
alternative class such as dojo.widget.Widget. My apologies if this is
already fixed in the upcoming 0.3 release. Any thoughts by people on
the list?
Regards,
Bob Remeika
________________________________
_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo-interest at dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mastodon.dojotoolkit.org/pipermail/dojo-interest/attachments/20060405/573e633f/attachment-0001.html
More information about the Dojo-interest
mailing list