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 8794303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:13:59+00:00 2026-06-13T23:13:59+00:00

I have a problem: I’m opening a template based view from a controller and

  • 0

I have a problem: I’m opening a template based view from a controller and I am getting this error.
What can be the cause of this error?

Controller:

define([ 
    "dojo/_base/declare", "dojo/_base/lang", 

    "models/RestStorage", 
    "views/userPage/UserPage" 
], function (declare, lang, RestStorage, UserPage) { 
    return declare(null, { 
        systemUser:"", 

        constructor:function (options) { 
            lang.mixin(this, options); 
            this.model = new RestStorage(); 
        }, 
        init:function () { 
            this.view = new UserPage({model:this.model}, "container"); 
        } 
    }); 
}); 

View:

define([ 
    "dojo/_base/declare", "dojo/_base/lang", "dojo/Evented", 

    "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dojo/text!./user-page.html", 

    "dojox/mvc/Group", "dojox/mvc/Repeat", "dojox/mvc/Output" , "dijit/form/Button" 
], function (declare, lang, Evented, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template) { 
        return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented], { 
            templateString:template, 
            model:null, 

            constructor:function (options) { 
                lang.mixin(this, options); 
            } 
       }); 
    } 
); 

And template:

<section id="userPage">
    <header id="userPageHeader">
    </header>
    <section id="userPageContent">
        <p data-dojo-type="dojox/mvc/Group" data-dojo-props="ref: this.model">
            Current count: <br/>
            Max count: 
        </p>
    </section>
    <footer id="userPageFooter">
    </footer>
</section>

Update:
this is my index.html and app.js:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>MNSolution</title>
    <link rel="stylesheet" href="resources/js/lib/dijit/themes/claro/claro.css" media="screen"/>
    <link rel="stylesheet" href="resources/css/main.css"/>
    <script>
        var dojoConfig = {
            async:true,
            baseUrl:"resources/js/",
            packages:[
                {name:"dojo", location:"lib/dojo" },
                {name:"dijit", location:"lib/dijit" },
                {name:"dojox", location:"lib/dojox" },
                {name:"app", location:"app", main:"app" },
                {name:"controllers", location:"app/controllers"},
                {name:"views", location:"app/views"},
                {name:"models", location:"app/models"}
            ],
            has:{
                "dojo-debug-messages":true
            },
            isDebug:true,
            parseOnLoad:true,
            deps:[ "dojo/parser", "app/app" ]
        }
    </script>
    <script src="resources/js/lib/dojo/dojo.js"></script>
    <script>
        require(["dojo/parser", "app/app"], function (parser, App) {
            parser.parse();
            var application = new App();

        });
    </script>
</head>
<body class="claro">
<div id="container"></div>
</body>
</html>

define([
//    Base modules
    "dojo/_base/declare", "dojo/_base/lang",
//    login and user page controllers
    "controllers/LoginController", "controllers/UserPageController",
//    ready!
    "dojo/ready"
], function (declare, lang, LoginController, UserPageController) {
    return declare("app", null, {
        loginController:null,
        userPageController:null,

        constructor:function () {
            this.loginController = new LoginController();

            if (!this._checkAuth()) {
                this.loginController.init();
                this.loginController.on("loginSuccess", lang.hitch(this, function () {
                    this._loginSuccess();
                }));
            } else {
                this._loginSuccess();
            }
        },
        _checkAuth:function () {
//TODO check auth
            return true;
        },
        _loginSuccess:function () {
            this.userPageController = new UserPageController({});
            this.userPageController.init();
        }
    });
});
  • 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-13T23:14:00+00:00Added an answer on June 13, 2026 at 11:14 pm

    I notice that you have some id attributes set in your template. It’s normally bad form to do this as it can result in duplicate ids when you use a widget more than once on a page. This can result in the duplicate id error you describe in the title.

    If you are using the ids for css-styling then you can probably work around this with class attributes. If they are for referencing within your code, use data-dojo-attach-point.

    data-dojo-attach-point: This will assign the dom node it is attached to, to a property within the object parsing the template. (Note: you are using dijit/_WidgetsInTemplateMixin, if the node is a widget to be parsed the property will be assigned to the widget rather than it’s dom node).

    eg:

    <section data-dojo-attach-point="userPage">
        <header data-dojo-attach-point="userPageHeader">
        </header>
        <section data-dojo-attach-point="userPageContent">
            <p data-dojo-type="dojox/mvc/Group" data-dojo-props="ref: this.model">
                Current count: <br/>
                Max count: 
            </p>
        </section>
        <footer data-dojo-attach-point="userPageFooter">
        </footer>
    </section>
    

    This will assign the outer <section> node to this.userPage within the widget, this.userPageHeader will reference the <header>, …etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have problem while getting data from Memcached on .NET MVC solution. I have this
i have problem to pass data from view to controller , i have view
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with getting the Activity from my Fragment. I have read several
I have problem with my query on C, I’m using the oci8 driver. This
I have problem with UIWebView delay when the load image from url. In my
i have problem to show only day or month from dob in mysql. i
I have problem when creating a file in encoding 'utf-8' and reading it from
i have problem with build my own webservice based on cxf/camel. My webservice should
I have problem adding markers into marker Clusterer of Google Maps. Firebug returns error:

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.