Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2443 closed defect (invalid)

dojoAttachPoint does not work with ContentPane or LayoutContainer

Reported by: Rhapidophyllum Owned by: bill
Priority: high Milestone:
Component: Widgets Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:


It appears that dojoAttachPoint does not work with ContentPane? or LayoutContainer?.

For example, 1) works correctly, whereas 2) does not:

1) <div dojoAttachPoint="testNode">Test Text</div> 2) <div dojoType="dojo:ContentPane" dojoAttachPoint="testNode">Test Text</div>

Below are the results using: dojo.debug( this.testNode.innerHTML );

1) Test Text 2) undefined

Change History (3)

comment:1 Changed 14 years ago by bill

Resolution: invalid
Status: newclosed

It looks like you are getting confused between templates and markup. dojoAttachPoint is used in the widget templates; only widget developers reference it. dojoType is used in the main document.

comment:2 Changed 14 years ago by Rhapidophyllum

I was referring to its use in widget templates, for composite widgets. The problem was in getting the JS file to access the correct dom element, since 'dojoAttachPoint' must be used instead of 'id'. I think I have found the answer, though. It appears that dojoAttachPoint is a variable referring to 1) a dom node for a non-dojo item, but 2) a dojo widget (if it's a dojo widget).

A function like getContentBox() apparently must work on a dom node, but not a dojo widget. So if 'attachPoint' refers to a dojo widget, to get it to work, change:

dojo.html.getContentBox( this.attachPoint );


dojo.html.getContentBox( this.attachPoint.domNode );

Hopefully this info about dojoAttachPoint can get added to the documentation at some point. Current info that I could find said that dojoAttachPoint simply refers to a dom node.

comment:3 Changed 14 years ago by bill

Ah right, unfortunately we need documentation on widgetsInTemplate. Anyway, what you said is correct.

Note: See TracTickets for help on using tickets.