Changes between Initial Version and Version 2 of Ticket #10988


Ignore:
Timestamp:
Apr 13, 2010, 11:58:47 PM (9 years ago)
Author:
bill
Comment:

This is expected behavior as explained in #10466, basically so that onChange() isn't called twice w/the same value. (And after all, a variable called _lastValueReported should contain the last value that was _reported_.) You can get the behavior you want by resetting _lastValueReported after a call to attr("value", foo, false).

Passing to Doug, I think we want to close this as wontfix but maybe he can add more info. I think there might have been some internal reason we don't do this too, but not sure.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10988

    • Property Owner set to Douglas Hays
    • Property Priority changed from highest to normal
    • Property Severity changed from critical to normal
  • Ticket #10988 – Description

    initial v2  
    22
    331) set a value on a form widget - .attr("value", valueA);
     4
    452) set the value without priorityChange - .attr("value", valueB, false);
     6
    573) revert the value with priorityChange - .attr("value", valueA);
    68
    7 the onChange event will fire for #1 (as it should), fail to fire for #2 (as it should), and fail to fire for #3 (as it SHOULDN'T)
     9The onChange event will fire for {{{#1}}} (as it should), fail to fire for {{{#2}}} (as it should), and fail to fire for {{{#3}}} (as it SHOULDN'T)
    810
    9 the reason is because the _lastValueReported property of the widget object still has valueA after valueB has been set without priority change. If it had been set to valueC in step #3, it would have fired onChange as expected.
     11The reason is because the _lastValueReported property of the widget object still has valueA after valueB has been set without priority change. If it had been set to valueC in step {{{#3}}}, it would have fired onChange as expected.