Opened 5 years ago

Closed 5 years ago

#18184 closed defect (invalid)

BorderContainer in _WidgetsInTemplateMixin with outside BorderContainer

Reported by: dmol Owned by: dmol
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:

Description

Hello!

I have outer BorderContainer?, which contains my custom Widget, which contains BorderContainer? inside it. When I insert the widget via button, as described in reference [1], then all works OK.

But when I try to insert it right after loading of main template, I got:

dojo/parser::parse() error 
Error {stack: (...), message: "Tried to register widget with id==dijit_layout_BorderContainer_0 but that id is already registered"

When I disable my another custom widget (LoginArea?), then I got no error, but the inner BorderContainer? isn't layered correctly (as if no .startup() has been invoked).

[1] http://dojotoolkit.org/reference-guide/1.10/dijit/layout/BorderContainer.html#dijit-layout-bordercontainer

Attachments (5)

index.html (2.5 KB) - added by dmol 5 years ago.
index.html
HomeArea.js (718 bytes) - added by dmol 5 years ago.
profundus/widgets/HomeArea.js
LoginArea.js (779 bytes) - added by dmol 5 years ago.
./profundus/widgets/LoginArea.js
HomeArea.html (489 bytes) - added by dmol 5 years ago.
profundus/widgets/templates/HomeArea.html
LoginArea.html (47 bytes) - added by dmol 5 years ago.
profundus/widgets/templates/LoginArea.html

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by dmol

Attachment: index.html added

index.html

Changed 5 years ago by dmol

Attachment: HomeArea.js added

profundus/widgets/HomeArea.js

Changed 5 years ago by dmol

Attachment: LoginArea.js added

./profundus/widgets/LoginArea.js

Changed 5 years ago by dmol

Attachment: HomeArea.html added

profundus/widgets/templates/HomeArea.html

Changed 5 years ago by dmol

Attachment: LoginArea.html added

profundus/widgets/templates/LoginArea.html

comment:1 Changed 5 years ago by ben hockey

Owner: set to dmol
Status: newpending

i think the problem is that you're not waiting for the parser to finish it's work before you add your custom widget and this causes a double parse.

var promise = parser.parse();
require([ ... ], function ( ... ) {
    var widget = new Thing();
    // wait for parsing to finish before adding anything...
    promise.then(function () {
        widget.placeAt('somewhere');
    });
});

does it fix it if you wait for the parser to finish?

comment:2 Changed 5 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.