Try our conversational search powered by Generative AI!

Dojo: Get widget to update

Vote:
 

So, doing my first widget in dojo and having some issues.

Background:

I have two dropdown lists and I want the choice of the first to update the second. To do this I have registered two Editors, EnumEditor and ElectedEditor both are extensions of the epi.cms.contentediting.editors.SelectionEditor.

In EnumEditor I have added a publication of a topic in the _updateSelection

topic.publish("EnumEditor_updateSelection", value);

    

Now in my ElectedEditor I'm subscribing to this in the postCreate function

topic.subscribe("EnumEditor_updateSelection", this._updateData());

    

The updateData function is defined as

_updateData: function ()
        {
            this.options = array.map(this.selections, function (item) {
                return {
                    label: item.text,
                    value: item.value,
                    selected: (item.value == this.value) || (!item.value && !this.value)
                };
            }, this);

            this.actualValue = this.value;
        },

    

Running this however gets me a TypeError {} in dojo.js

StackTrace

TypeError {} dojo.js:3718
(anonymous function) dojo.js:3718
dojo.Deferred.reject.errback dojo.js:3718
notify dojo.js:3688
dojo.Deferred.promise.then.then dojo.js:3785
(anonymous function) widgets.js:2
hitch dojo.js:11044
runFactory dojo.js:1043
execModule dojo.js:1169
checkComplete dojo.js:1192
onLoadCallback dojo.js:1352
req.injectUrl.onLoad

And now I'm stuck so.. Anyone got something helpful to share on the subject?

#76078
Oct 16, 2013 15:52
Vote:
 

Hi Petter, have you succeeded with this? I also have a similar requirement and having issues. 

I posted this on the forum but no luck yet http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=76857&epslanguage=en.

Would you mind sharing you code with me santosh.achanta@intergen.co.nz if you have succeeded?

#76904
Nov 06, 2013 4:13
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.