Hi, I'm new to Dojo world. I tried to create a custom dojo widget from scratch.The problem that I'm facing is the widget is not getting parsed. I see that postCreate method of that widget is not getting called. The widget JS file is being downloaded from the server.
Here are the steps what I followed.
Created a javascript file CustomWidget.js in test folder.
dojo.provide('test.CustomWidget'); dojo.require('dijit._Widget');
dojo.declare('test.CustomWidget',dijit._Widget, { text:"Hello World",
postCreate:function() { console.log(this.text+'text'); this.domNode.innerHTML=this.text; } });
In my jsp file,I imported test.CustomWidget using dojo.require.
dojo.require('mindtree.CustomWidget'); dojo.addOnLoad(function(){dojo.parser.parse("addFavorites");});
I can see that CustomWidget.js file is being downloaded, but I don't see the console statement being printed. Can someone plese help me?
Thanks in advance Mahi