Trying to understand layers and parsing in dojo 1.7

Putting out-of-context code here for reference, don't be alarmed. This is my attempted modification of this great dojo 1.7 builds example to use declarative widgets.

If anybody can spot the problem or give me hints, that would be much appreciated-- the programmatic widget shows up, but the declarative one doesn't. I get an error saying "Could not load class 'mycompany.widgets.Example".


<body>
	<div id='app'>
		<p>loading webapp programatically...</p>
	</div>
	
	<div data-dojo-type='mycompany.widgets.Example'>
		<p>loading webapp declaratively...</p>
	</div>

	
	<script>
		 var dojoConfig = {
			 async: 1,
			 parseOnLoad: false
		 };
	</script>
	<script src='/mywebapp/scripts/release/dojo/dojo.js'></script>
	
	<script>
		require(['dojo/_base/kernel','dojo/parser','dojo/_base/loader'], function(dojo, parser){

			dojo.registerModulePath('mycompany','../mycompany');

			require(['mycompany/layers/core', 'mycompany/layers/example'], function() {
			  require(['mycompany/widgets/Example','dojo/ready'], function(Example, ready) {
				ready(function(){
					new Example({}, 'app');
					parser.parse();
				});
			  });
			});
			
		});
	</script>
</body>

Comments






There’s more.