Opened 11 years ago

Closed 11 years ago

#12426 closed defect (fixed)

Changes to a do not fire watch("value",...

Reported by: Ed Chatelain Owned by: Shane O'Sullivan
Priority: high Milestone: 1.7
Component: DojoX Mobile Version: 1.6.0
Keywords: Cc: ben hockey, Douglas Hays
Blocked By: Blocking:

Description (last modified by bill)

Changes to a result in call to onChange, but do not call watch("value",...

The patch below for text-input-assistant.js can be used to recreate the problem. After applying the text-input-assistant.js.patch just run the dojox/mobile/tests/inputApp and update the simpleTextInput You will see in the console that onChange was called, but the watch was not called.

The problem is in _FormWidget.js the _FormWidget.js.patch has the fix. _FormWidget.js has 2 issues, first _FormValueWidget seems to be missing the _handleOnChange: function (which from looking at in dijit.form._FormWidgetMixin) should call this._set("value", newValue); .

After the change above, it still did not work because the _setValueAttr function in is setting this.value = newValue; before calling this._handleOnChange(newValue, priorityChange); Setting this.value stops the watch from being called because it was will only fire the watch if the old value is not equal to the new value. In the patch I commented out the call to this.value = newValue; so with the patch watch("value") will be called when an update is made.

Patch from Ed (IBM, CCLA) to follow.

Attachments (2)

text-input-assistant.js.patch (849 bytes) - added by Ed Chatelain 11 years ago.
_FormWidget.js.patch (1023 bytes) - added by Ed Chatelain 11 years ago.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by Ed Chatelain

Changed 11 years ago by Ed Chatelain

Attachment: _FormWidget.js.patch added

comment:1 Changed 11 years ago by ben hockey

Cc: ben hockey added

comment:2 Changed 11 years ago by bill

Cc: Douglas Hays added
Description: modified (diff)

I think the goal is to just get rid of and use, right? (Hopefully watch() is working there, it should be.)

comment:3 Changed 11 years ago by Ed Chatelain

Thanks Bill, Yes does fire the watch. I will change my code to use it. If is what we should be using it would be good to have at least one mobile test testing it. Currently all of the tests in using a TextBox? are using

comment:4 Changed 11 years ago by bill

Milestone: tbd1.7
Resolution: fixed
Status: newclosed

At this point just points to, so this issue must be resolved.

Note: See TracTickets for help on using tickets.