#9568 closed defect (fixed)
dijit.Tooltp doesn't work when is instantiated from inside of other widget template
Reported by: | Aleksey Rechinskiy | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit | Version: | 1.3.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hi!
Please, take a look into attached test file.
It creates a new widget with dojo.declare(), based on [dijit._Widget, dijit._Templated], with widgetsInTemplate:true and templateString set to a string with dijit.layout.BorderContainer? widget inside. Inside of a second pane of BorderContainer? there is a dijit.Tooltip, that doesn't appears, while it must.
Run a page, click on the "resize" button (it is necessary to deal with #9567 ) and open a Pane 2 of BorderContainer?. Big text has a dijit.Tooltip attached, but it won't fire. The same HTML as templateString works as expected when is parsed on page load directly from a page.
This test case also demonstrates #9567 for BorderContainer?.
Attachments (1)
Change History (7)
Changed 10 years ago by
Attachment: | 090718 tooltips.html added |
---|
comment:1 Changed 10 years ago by
Component: | General → Dijit |
---|---|
Milestone: | tbd → future |
Owner: | anonymous deleted |
comment:2 Changed 10 years ago by
Yes, you are right, it is still happening.
An easy workaround is probably to call myTooltip.addTarget("TMR_h1title") inside of wj.startup(), rather than writing connectId="TMR_h1title" in the template.
Well, yes, that is true. But the most tasty thing in templates is that they usually don't require any king of post creation processing :) It would be so convenient to instantiate nice looking tooltips directly from the widget's template ;))
comment:3 Changed 10 years ago by
Milestone: | future → 1.4 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
Fair enough, I think I can fix this w/a few lines of code that do connections in startup() iff it wasn't able to connect in postCreate(). Thus the startup() call will only be necessary in corner cases like this one.
comment:4 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I assume this is still happening even after the fix to #9348 (on trunk).
This is an unusual case... probably the tooltip is created before your "wj" widget's DOM tree is added to the document (where the
<div dojoType="wj">
used to be). So it's not surprising that the tooltip can't find theid="TMR_h1title"
node.An easy workaround is probably to call myTooltip.addTarget("TMR_h1title") inside of wj.startup(), rather than writing
connectId="TMR_h1title"
in the template.Another alternative would be to make dijit.Tooltip do it's connections in startup() rather than postCreate(), but I don't want to change Tooltip to require startup() to be called.