Roundup Tracker - Issues

Issue 2550796

classification
Calendar and Classhelp selection tools don't cause onchange event to be triggered.
Type: behavior Severity: normal
Components: Web interface Versions: 1.4
process
Status: fixed fixed
:
: rouilj : ber, rouilj
Priority: normal : Effort-Medium

Created on 2013-02-23 23:33 by rouilj, last changed 2017-01-29 02:08 by rouilj.

Messages
msg4802 Author: [hidden] (rouilj) Date: 2013-02-23 23:33
The current code for calendar and the classhelp "widgets" can change
an input field, but they don't trigger the field's onchange
event.

http://stackoverflow.com/questions/2856513/trigger-onchange-event-manually

recommends one method by adding:

if ("fireEvent" in element)
    element.fireEvent("onchange");
else
{
    var evt = document.createEvent("HTMLEvents");
    evt.initEvent("change", false, true);
    element.dispatchEvent(evt);
}

to force the function that does the change to the field to trigger
the onchange event. This should probably be done in pure javascript
and not reply on any particular javascript libs like jQuery.

I noticed this because the templates I am designing have onchange
events that change the background color of the label to indicate that
the form has been changed so people don't forget to commit their changes.
msg4840 Author: [hidden] (ber) Date: 2013-04-10 19:18
Sounds like a good idea. 
If you cannot think of any drawbacks, just commit something for it.
msg5923 Author: [hidden] (rouilj) Date: 2017-01-29 02:08
I used slightly different code (the then and else cases are flipped).
Committed as: e8b3d3a14563

The helper popups could use some work. There is code that has the same
function, but that are named differently. Some code is inlined in the
html page, some calls function in an external .js library.

But that is for another day.
History
Date User Action Args
2017-01-29 02:08:53rouiljsetstatus: open -> fixed
resolution: fixed
messages: + msg5923
2017-01-29 01:55:51rouiljsetstatus: new -> open
2016-06-27 03:49:39rouiljsetassignee: rouilj
2013-04-10 19:18:56bersetnosy: + ber
messages: + msg4840
2013-02-23 23:33:34rouiljcreate