PDA

View Full Version : [OPEN] Potential Bug in TextField Change Event.



Kcarpenter
7 Jun 2011, 7:39 AM
Just curious if this is really a bug or bad documentation or I am possibly doing something wrong.



change (http://docs.sencha.com/ext-js/4-0/#/api/Ext.form.field.Field-event-change)( Ext.form.field.Field this, Mixed newValue, Mixed oldValue )Fires when a user-initiated change is detected in the value of the field.


You will notice the change event is supposed to fire when a "user-initiated' change is detected.

Now the problem, or possible bug:
I have a form, and use .loadRecord(rec) to load a record into it. When I do this, all of the forms TextField Change events are fired off, I get that - because the field goes from an Undefined value to a value of the record set. This isn't really a "user-initiated' event, because I am loading the record when a form loads.

A user-initiated event, I would think is a user typing in a form - not the api rendering the form.:-?

The question is, What's wrong? The Docs? The Event? or my understanding?
:-/:-/:-/

bregard
26 Jul 2011, 10:47 AM
Just curious if this is really a bug or bad documentation or I am possibly doing something wrong.



You will notice the change event is supposed to fire when a "user-initiated' change is detected.

Now the problem, or possible bug:
I have a form, and use .loadRecord(rec) to load a record into it. When I do this, all of the forms TextField Change events are fired off, I get that - because the field goes from an Undefined value to a value of the record set. This isn't really a "user-initiated' event, because I am loading the record when a form loads.

A user-initiated event, I would think is a user typing in a form - not the api rendering the form.:-?

The question is, What's wrong? The Docs? The Event? or my understanding?
:-/:-/:-/

Having the same problem. Did you figure this out? Is there a way to detect if the event was really user initiated?

bregard
26 Jul 2011, 10:52 AM
I can just check to see if oldValue is undefined. Doesn't feel right.

germanicus
28 Jul 2011, 5:52 PM
We agree this is a bug, and I've submitted a ticket.