#11547 closed defect (fixed)
InlineEditBox doesn't fire onChange on call to attr("value", ...)
Reported by: | Stefan Bird | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | low | Milestone: | 1.6.1 |
Component: | Dijit | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
If you call attr("value", ...) to set the value of an InlineEditBox, it does not fire an onChange event - onChange only get fired when save() is called.
var box = new InlineEditBox({onChange: function() { console.log("fired"); }}); box.attr("value", "New value");
Expected: "fired" written to the console
Actual: onChange() isn't called.
Change History (9)
comment:1 Changed 10 years ago by
Owner: | set to Douglas Hays |
---|
comment:2 Changed 10 years ago by
Milestone: | tbd → 1.6 |
---|---|
Status: | new → assigned |
comment:3 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 10 years ago by
Hi guys, has this bug crept back into the official 1.6. My inlineeditbox's don't have their onChange fired when I use dojo 1.6, they work perfectly with dojo 1.5.
I create them like
var comment_text_edit = new dijit.InlineEditBox({ id: "editbox_"+ap_com+"_"+dbid, autoSave: false, onChange: function (value) { //do x } },comment_text);
comment:5 Changed 10 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.6 → 1.6.1 |
Doug addressed in #12580.
comment:6 Changed 10 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
this doesnt work at all. I have assigned an onChange handler but when clicking Save nothing happens. The onChange is not executed. http://pastebin.com/EdM6ehif
comment:7 Changed 10 years ago by
the culprit is this code snippet:
if(this._started){ // tell the world that we have changed setTimeout(dojo.hitch(this, "onChange", val), 0); // setTimeout prevents browser freeze for long-running event handlers }
this._started is "undefined"
comment:8 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
The committed fix works for me, and the supplied pastebin snip-it also works well on both 1.6 branch and trunk sources. The pastebin snip-it is invalid since it calls the asynchronous require and then instantiates the widget before giving the javascript time to load. So I just moved the require outside the addOnLoad and put it in the HEAD section. I also ran the test on both IE7 and FF4.
(In [23295]) Fixes #11547. Add onChange support for programmatic set('value',...) calls, and add an automated test.