Hi bar10dr,
Appreciate the simplified example.
I'd start by removing your _setValueAttr you're overriding the base functionality and not calling the original function, which is done via:
this.inherited(arguments);
Anyway, more on that here: https://g00glen00b.be/dojo-inheritance-overriding-extending/
Then you don't need to set both the value and textbox value with:
this.textbox.value = value;
this._set("value", value);
You can just call:
this._setValueAttr(value);
which is preferred.
The key thing is then that you need to set the focus with:
this.onFocus();
Long story short, the following should work:
return declare([_Widget, _TemplatedMixin, _ValueRequiredMixin, _HasChildDialogMixin, TextBox], {
intermediateChanges: true,
isValid: function () {
return true;
},
postCreate: function () {
this.inherited(arguments);
myDojo = this;
},
_saveNewValue: function (value) {
if (!this._started) {
return;
}
console.log('saving');
this.onFocus();
this._setValueAttr(value);
}
});
I have a custom dojo plugin that uses a jquery dropdown plugin where the user selects one or more items, those items are added to the dojo textbox.
But whenever I fire onChange, the page save doesn't trigger. It only triggers if the original textbox is focused by the user.
In order to condense the problem I've written a short example of the problem
(To test just run saveNewValue() from console to trigger pagesave)
If I manually change the value of the textbox, the page save and publish options functions as it should.
Any tips?