Login Register

The Dreaded Namespace Resolution?

[EDIT: fixed it, must have been the trailing div.]

Hello:

My company and have I been using dojo 0.4 (I know - the codebase is too big to migrate right now) and have several custom widgets, all of which are working fine. For a proof of concept, however, I'm grabbing a custom tree component from the page(it's form-based widget and so it has user modifications), parsing it back into divs and then re-adding the divs to the page in a second placeholder div. I write it back in the following method:

function foobar() {  
      	var myTreeNode = dojo.widget.manager.getWidgetById("foo");  //get the widget code from the page
      	var myTreeContent = myTreeNode.asXML();  //convert it to divs
      	var treeContainer = document.getElementById("myWidgetContainer");  //get placeholder div

at this point I try to write it back to the DOM. I've tried several ways, such as:

treeContainer.innerHTML = myTreeContent;
		    dojo.widget.createWidget(myTreeContent);

or even:

var testObjects = new dojo.xml.Parse();
				testItems = testObjects.parseElement(document.getElementById("foobar"));
				dojo.widget.getParser().createComponents(testItems);
  }

but they all fail with the following error:
DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not locate widget implementation for "<div dojoType="circleup:selectabletree" showgrid="false" widgetid="foo"><div etc....

Basically I'm trying to write a custom dojo component to the page after onload.

I've been told that this is a namespace resolution issue. I've created a myns.js in the folder that houses dojo and our widgets and it is

dojo.provide("circleup.manifest");
dojo.require("dojo.string.extras");
dojo.registerNamespaceResolver("circleup", function(name)
{
    var realName = dojo.string.capitalize(name);
    var module = "circleup.widget." + realName;
    return module;
});

but this doesn't seem to help. Any ideas or can anyone point me to some documentation (that doesn't come up as a 404)?

Thanks in advance.