I’ve been struggling with a Dojo Widget for EPiServer, but no matter what I tried, the onChange event dit not make EPiServer save the new value. I’m not sure how many hours I kept on googling my way through various blog posts and tutorials, until I stumbled upon this:
Finally, the answer I was looking for was right before my eyes:
dijit._Widget inherits from dijit._WidgetBase; when defining your own custom widgets, you should always inherit from dijit._Widget (or one of the widgets available in Dijit), and not from dijit._WidgetBase.
Of course, the examples I had been copying so far were inheriting from _WidgetBase, and when I changed this to _Widget, everything started to work as it should. Bliss!
(I’m just posting this in case some other unlucky coder is struggling with the same thing…)
By the way, here are a few good resources for starting to code your own EPiServer Dojo Widgets:
Without these, I would have been even more stuck… :)