Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1388 closed defect (invalid)

dojo.require Bug?

Reported by: [email protected] Owned by: James Burke
Priority: high Milestone:
Component: Loader Version: 0.3
Keywords: Cc: [email protected]
Blocked By: Blocking:


If I:



Then NamespacedTagToComponentClassMap? loads fine insde the html test page.



is commented out, the other no longer loads.

Here is the test page:

<!DOCTYPE html

PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "">

<html xmlns=""

xmlns:dojo="" xml:lang="en" lang="en">


<title>AbstractViewHandler? Test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script language="JavaScript?" type="text/javascript">

Dojo configuration djConfig = {

isDebug: true


</script> <script

type="text/javascript" src="../../../../../../lib/dojo/dojo.js">

</script> <script

type="text/javascript" src="../../../../../../lib/jsunit/app/jsUnitCore.js">

</script> <script language="JavaScript?" type="text/javascript">

dojo.require('dojo.widget.*'); dojo.require('dojo.widget.Button'); dojo.require("dojo.presentation.application.NamespacedTagToComponentClassMap?");


</head> <body>

<script language="JavaScript?" type="text/javascript">

dojo.require("dojo.presentation.application.NamespacedTagToComponentClassMap?"); dojo.declare("dojo.presentation.components.Button", null, {

componentType: "dojo.presentation.components.Button", componentFamily: "a really nice family",


dojo.declare("com.organization.Button", null, {

componentType: "com.organization.Button", componentFamily: "a really nice family",


map = new dojo.presentation.application.NamespacedTagToComponentClassMap?(); map.add("dojo:button", "dojo.presentation.components.Button"); map.add("organization:button", "com.organization.Button");

function testGetComponentClass() {




</body> </html>

Here is the NamesapcedTag? code....

dojo.provide("dojo.presentation.application.HTMLViewHandler"); dojo.require("dojo.collections.Dictionary");


  • This has to be initialized by the page loading the component libraries */

dojo.declare("dojo.presentation.application.NamespacedTagToComponentClassMap?", dojo.collections.Dictionary, {

getComponentClass: function(tag) {

if (this.contains(tag)) {

return this.entry(tag);

} else {

dojo.raise("Can not create component for tag: " + tag, Error("Component Creation Exception"));




Attachments (1)

testNameSpacedTagToComponentClassMap.html (1.6 KB) - added by guest 15 years ago.

Download all attachments as: .zip

Change History (7)

Changed 15 years ago by guest

comment:1 Changed 15 years ago by guest

This might be a separate bug/issue:

When I run this test, it passes: try {



catch(e) {

Test Passed - Sort of - Dojo raise swollows the exception or something...


And if I simply do this:


It also passes, although if you open the test page in a browser, dojo does show the error message. It looks like dojo.raise() swollows the exception...

comment:2 Changed 15 years ago by [email protected]

Dojo also shows the

FATAL: Can not create component for tag: monkey: Component Creation Exception

When I catch the exception.

Since I'm using try catch I knew that there was a possibility of this error and I wanted to catch it and deal with it myself without any 'assistance'.

The message appears regardless of whether debug is set to true or false...

comment:3 Changed 15 years ago by dylan

Component: GeneralPackageSystem
Milestone: 0.4
Owner: changed from anonymous to alex

comment:4 Changed 15 years ago by James Burke

Owner: changed from alex to James Burke

Stealing io and package bugs from Alex. Holler if you want it back.

comment:5 Changed 15 years ago by James Burke

Cc: [email protected] added
Resolution: invalid
Status: newclosed

Try doing a dojo.require("dojo.lang.declare"); at the top of NamespacedTagToComponentClassMap?.js. I think that will fix the problem. See my comments in trac #1358 for more information.

Closing as resolved/invalid, but feel free to reopen with more information if the dojo.require("dojo.lang.declare") does not work.

comment:6 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.