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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:07:06+00:00 2026-06-09T20:07:06+00:00

I am trying to add a dojo widget to a page. Because it is

  • 0

I am trying to add a dojo widget to a page. Because it is an old application, I’m using dojo 1.6. The widget is defined in a js file with an HTML template and a CSS file defining some extra options.

I am working with JSP and JSPF, and for some reason (possibly the difference between the two?) when I put <script> tags in the JSPF file I am working with they do not run when the page loads. I figured I would sort this out later and in the meantime just to test other stuff I put code in the header JSP file that does run script tags.

dojo.require("x.y.z");

<div
    id="testDiv"
    dojoType="x.y.z" onclick="dojo.parser.parse()">abc</div>

This works the way I want it to. There’s a div, and when I click on it it loads the dojo widget with the template I defined.

In the JSPF file, I put the same div (abc), and then I also did something similar, but going up another step:

<div onclick="
    dojo.require('x.y.z');
    var n = document.createElement('div');
    n.setAttribute('id', 'xyz');
    n.setAttribute('dojoType', 'x.y.z');
    n.setAttribute('onclick', 'dojo.parser.parse()')
    n.innerHTML = 'Test';
    document.body.appendChild(n);
    ">Click Me Please!</div>

The reason I put this in was that when I had just abc, it was giving me the following errors in Firebug:

Error parsing in _ContentSetter#Setter_1:13_0
Error: Could not load class 'x.y.z

Error undefined running custom onLoad code: This deferred has already been resolved
undefineddojo._scopeArgs = [undefined];

I figured this was because x.y.z was not being dojo.require’d, unlike the JSP when it was, and since I couldn’t get javascript to run automatically in jspf, I wrote “Click me please” to hackishly require in the onclick and then do the same thing, just to try to test things and get them working.

The idea of the second one was that I should be able to click on it and have the div appear from before. It seems to do the require fine and creates the div, but then when I click on the div it says

Tried to register widget with id==(numbers) but that id is already registered

So I figured that this was because I was just running dojo.parser.parse over everything, and it was catching things already on the page – really I should just run it on the new thing I made. So I was trying to figure out how to do dojo.parser.parse on just one thing. I found information for 1.8 and 1.7 but not 1.6. How can I do this, and am I understanding things correctly and making good assumptions?

  • 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-09T20:07:08+00:00Added an answer on June 9, 2026 at 8:07 pm
    Error: Could not load class 'x.y.z
    

    Means you are calling require for a class which is not found in package description location. x.y.z translates into a relative path from the dojo.js file (included via script-tag) as follows:

     <!-- if -->
     <script src="/server/path/dojotoolkit/dojo/dojo.js"></script>
     <!-- then -->
     <script>dojo.require("x.y.z");</script>
     <!-- equals -->
     <script src="/server/path/dojotoolkit/dojo/ ../x/y/z.js"></script>
    

    Since class fails to load, proable cause is file does not exist and you have a HTTP 404 error.

    In terms of this error message:

    Tried to register widget with id==(numbers) but that id is already registered
    

    This means that you have created the widget (you set unique id: testDiv) twice. Probably because div onclick is called twice.. dijit widgetId’s must remain unique – and if you desperately need to create a new one with same id, call dijit.byId(id).destroy(); first.

    Easy out is to leave no id in your markup, then a generic auto-incrementing id will be generated.

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

Sidebar

Related Questions

I am trying to upload Excel only file in Struts2 WEB Application. So using
i'm new to django and im trying add a user using django admin page.
I'm trying add a tab to my web page that looks like this: Using
I'm trying to do an ajax file upload using dojo.io.frame.send(). It works with FF
Trying to add a class object into a List using reflection, but when invoking
I'm trying to add a new FilteringSelect widget dynamically to a preexisting form I
Trying to add a 'class' html attribute, but I think the keyword 'class' is
Trying to add text to QGraphicsView: Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this);
I am trying to add a delete button to the Dojo Datagrid and I
I am trying add on dimension of an array together into a variable using

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.