Opened 10 years ago

Closed 10 years ago

#8041 closed defect (invalid)

problem inserting programmatically a widget with widgetsInTemplate

Reported by: yherve Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.2.0
Keywords: widgetsInTemplate Cc:
Blocked By: Blocking:

Description (last modified by bill)

Hello dojo team,

[problem reproduced on 1.2.1/ff3]

I have defined a widget containing other widgets in the template.

  • If I instantiate this widget from the markup, it is ok
  • If I instantiate this widget programmatically and attach it to a regular dom node, it is ok.
  • If I instantiate the widget programmatically and try to attach it to a ContentPane, it does not work:

It complains that it tries to register the widget a second time. What I think is happening is that when I insert the widget to the ContentNode?, the parser starts parsing the html and since it sees the already created 'widgetid', it is confused.

I tried to disable the parser in the contentPane with parseContent="false" but it still does not work.

I have the same problem when I try to insert the widget in a dijit.Dialog

Thanks

Yann

Attachments (1)

widgetInTemplatePb.html (1.7 KB) - added by yherve 10 years ago.

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by yherve

Attachment: widgetInTemplatePb.html added

comment:1 Changed 10 years ago by bill

Description: modified (diff)

Hi,

When you say "attach it to a ContentPane" are you referring to putting the new widget inside of a ContentPane?

The current code you have declares a ContentPane called "yyy":

<p dojoType='dijit.layout.ContentPane' id="yyy" ></p>

And then executes:

new ulcm.Form({}, "yyy");

... which means to turn the "yyy" node into a ulcm.Form... it's very strange, because "yyy" is a ContentPane already, so it's as though you are trying to overwrite one widget with another, which isn't a supported operation.

If you are trying to put ulcm.Form inside the ContentPane you could do

myContentPane.attr('content', "<div dojoType='ulcm.Form'></div>");

or even

myContentPane.domNode.appendChild(ulcm.Form.domNode);

comment:2 Changed 10 years ago by bill

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.