Picker onSelect handler not called if picker created through .createComponent ?

edited October 2012 in General
I've got two pickers, one defined in components: [] and the other created using createComponent after hitting a button, they both have onSelect: "selected" but selected never gets called for the pickers created using createComponents, how come?

I've made a jsfiddle here: http://jsfiddle.net/p7AUz/

Comments

  • edited October 2012
    Are you setting the owner property when you create the component? It may be looking in another kind for the "selected" function.

    edit: checked your fiddle, and setting the owner makes it work:

    add: function () { this.$.addAlarmPopup.createComponent({kind: "onyx.PickerDecorator", onSelect: "selected", components: [ {}, {kind: "onyx.Picker", components: [ {content: "1", active: true}, {content: "2"}, {content: "3"}, ]} ]}, {owner: this}); this.$.addAlarmPopup.render(); },
  • That did it! Thanks!
Sign In or Register to comment.