Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8733187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:36:02+00:00 2026-06-13T09:36:02+00:00

After adding in the WidgetsInTemplateMixin, I am receiving an error dest.appendChild is not a

  • 0

After adding in the WidgetsInTemplateMixin, I am receiving an error

dest.appendChild is not a function

In the documentation, it claims that there will be an error if this.containerNode is not able to contain any child objects. However, I have marked the containerNode attachment point for a div with dojo type “dijit/layout/ContentPane”. Can anyone explain to me why this isn’t working?

Here is the Template file

<div class="${baseClass}">
    <div class="${baseClass}Container"
         data-dojo-type="dijit/layout/BorderContainer"
         data-dojo-props="design: 'headline'">
        <div data-dojo-type="dijit/layout/ContentPane"
             data-dojo-props="region: 'top'">
            Top
        </div>
        <div data-dojo-type="dijit/layout/ContentPane"
             data-dojo-props="region: 'center'"
             data-dojo-attach-point="containerNode">
        </div>
        <div data-dojo-type="dijit/layout/ContentPane"
             data-dojo-props="region: 'leading', splitter: true">
            Sidebar
        </div>
    </div>
</div>

Here is the javascript definition

define([
    "dojo/_base/declare",
    "dijit/_WidgetBase",
    "dijit/_OnDijitClickMixin",
    "dijit/layout/BorderContainer",
    "dijit/layout/ContentPane",
    "dijit/layout/TabContainer",
    "dijit/_TemplatedMixin",
    "dijit/_WidgetsInTemplateMixin",
    "dojo/text!./templates/MainContainer.html"
], function (declare,
             _WidgetBase,
             _OnDijitClickMixin,
             BorderContainer,
             ContentPane,
             TabContainer,
             _TemplatedMixin,
             _WidgetsInTemplateMixin,
             template)
{

    return declare([_WidgetBase, _OnDijitClickMixin, _TemplatedMixin, _WidgetsInTemplateMixin], {

        templateString:template,
        baseClass:"main"
    });

});

The custom widget defined declaratively

<div data-dojo-type="main/ui/MainContainer" data-dojo-props="title: 'Main Application'">
  Hello Center!
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:36:03+00:00Added an answer on June 13, 2026 at 9:36 am

    Your question is worth researching. appendChild method only works with DOM Node. According to the source code, containerNode must be a DOM Node.

    dijit/_TemplatedMixin.js

     _fillContent: function(/*DomNode*/ source){
        // summary:
        // Relocate source contents to templated container node.
        // this.containerNode must be able to receive children, or exceptions will be thrown.
        // tags:
        // protected
        var dest = this.containerNode;
            if(source && dest){
                while(source.hasChildNodes()){
                dest.appendChild(source.firstChild);
            }
        }
    }, 
    

    Look at this dijit/_WidgetBase.js. The comment shows that the type of containerNode is DomNode.

    // containerNode: [readonly] DomNode
    //      Designates where children of the source DOM node will be placed.
    //      "Children" in this case refers to both DOM nodes and widgets.
    //      For example, for myWidget:
    //
    //      |   <div data-dojo-type=myWidget>
    //      |       <b> here's a plain DOM node
    //      |       <span data-dojo-type=subWidget>and a widget</span>
    //      |       <i> and another plain DOM node </i>
    //      |   </div>
    //
    //      containerNode would point to:
    //
    //      |       <b> here's a plain DOM node
    //      |       <span data-dojo-type=subWidget>and a widget</span>
    //      |       <i> and another plain DOM node </i>
    //
    //      In templated widgets, "containerNode" is set via a
    //      data-dojo-attach-point assignment.
    //
    //      containerNode must be defined for any widget that accepts innerHTML
    //      (like ContentPane or BorderContainer or even Button), and conversely
    //      is null for widgets that don't, like TextBox.
    containerNode: null,
    

    So, the containerNode has been desinged to be a DomNode, not a bug. It can’t be a widget. Maybe you should try some other ways.

    Update:
    Add some BorderContainers in custom widget

    ModuleWithGuideBar.html

    <div data-dojo-attach-point="containerNode" class="${class} ModuleWithGuideBar">
        <div class="ModuleGuideBar"
             data-dojo-type="dijit.layout.BorderContainer"
             data-dojo-props="region:'top', gutters:false"
             data-dojo-attach-point="guideBarFirst">
        </div>
        <div class="ModuleGuideBar"
             data-dojo-type="dijit.layout.BorderContainer"
             data-dojo-props="region:'top', gutters:false"
             data-dojo-attach-point="guideBarSecond">
        </div>
        <div class="ModuleContent"
             data-dojo-type="dijit.layout.BorderContainer"
             data-dojo-props="region:'center', gutters:false, liveSplitters:false"
             data-dojo-attach-point="moduleContent">
        </div>
    </div>
    

    Js file

    define([
        "dojo/_base/declare",
        "dijit/layout/BorderContainer",
        "dijit/_TemplatedMixin",
        "dijit/_WidgetsInTemplateMixin",
        "dojo/text!./templates/ModuleWithGuideBar.html"
    
    ], function (declare, BorderContainer, TemplatedMixin, _WidgetsInTemplateMixin, template) {
        return declare("common.widget.ModuleWithGuideBar", [BorderContainer, TemplatedMixin, _WidgetsInTemplateMixin], {
            templateString:template,
            region:"center",
            gutters:false,
            guideBarFirst:null,
            guideBarSecond:null,
            moduleContent:null
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

after adding the OCMock framework i got that strange error... :( ld: file not
I am getting this error after adding the libxml2.2.dylib file Linking /Users/Biranchi/Desktop/Funmovies TabBarController/build/Debug-iphonesimulator/funmovies.app/funmovies (1
After adding this short js code: $(document).ready(function() { //check to see if it's an
I'm working from this example and I am running into this error after adding
After adding an audio track (recorded with AVAudioRecorder) to a composition AVPlayer will not
After adding this to the end of my display function inside app/controllers/pages_controller.php , //
After adding elements to page using something like this, $('#blah').append('<div id=bugsbunny></div>'); how can I
After adding the Maven jFree dependency to my existing application, I'm not able to
After adding RelayCommand class (that uses CommandManager class) into my Silverlight App I've got
I have made strcat() function myself but after adding the string it is printing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.