-
5 Mar 2012 10:46 AM #1
BUG, RadioGroup event change is messed up.
BUG, RadioGroup event change is messed up.
Hello Team,
RadioGroup change event is having several issues:
1. Event is fired two times on each change(beside initial change in the group if no radio was configured as default.
2. newValue is object with property named after the name of the radios instead of holding the value itself.
3. As each change in the radio group fire the event two time. The first time newValue.radoName is array with the oldValue and the newValue. The second time is only the newValue.
Consider following work around handler as example:
Best regardsPHP Code:...
onFlexibleShiftsChange: function(field, newValue, oldValue, options) {
// Overwrite parameter as it is passed as object instead of value
var newValue = newValue.flexibleShifts;
// Event is fired 2 times on change, first time the value is array with the old and new value
// second time is only the new value. Check if this is the array case and skip it.
if(!Ext.isArray(newValue)) {
if(newValue === 0) {
field.next().show();
} else {
field.next().hide();
}
}
...
-
5 Mar 2012 10:50 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,085
- Vote Rating
- 453
We will see what we can do.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
5 Mar 2012 10:59 AM #3
Make sure the field is the exact same for both events.
Radio's used to use check event which fired twice once with the old and once with the new.
Since 4.x doesn't have the check event for radio's. I'm wondering if the change event picked up the old correct behavior.
http://www.sencha.com/forum/showthre...l=1#post507064
-
5 Mar 2012 11:08 AM #4
Not sure what you mean, you are digging too deep i think. My case is plain and simple radiogroup with two radios. Change is happening by a mouse click and not being programmed with setValue().
The expected behavior IMO is that the change should fire only once and with newValue being the newValue.
Thanks
-
5 Mar 2012 11:26 AM #5
If the change event behaves like the check event the check event used to get fired twice either by mouse click or setValue().
Make sure the field being passed on the event is the exact same one.
Can test it with alert(field.getId());
-
5 Mar 2012 11:42 AM #6
Looking in 3.4 api the radiogroup change event used to be this.
In 4.x it's using the standard on Change event from Ext.form.field.Field.Code:change( Ext.form.RadioGroup this, Ext.form.Radio checked ) Fires when the state of a child radio changes. Parameters this : Ext.form.RadioGroup checked : Ext.form.Radio The checked radio
Which is wrong and shows the standard behavior your noticing in that one got unchecked and the other one got checked.
Reason I said check the fields coming in cause I bet the getId() is different both times the event is fired.
-
5 Mar 2012 4:37 PM #7
I understand what you mean... the event listener is attached to both radios thus its get fired twice.
But again you are digging too deep, the how's and why's in this case are something that the maintainer should deal with I think. All I am doing here is to report something that does not seems to behave as expected in my opinion.
Thanks for your feedback.
-
5 Mar 2012 4:42 PM #8Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,085
- Vote Rating
- 453
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
5 Mar 2012 4:54 PM #9
My reply was to aw1zard2 as he is digging into hows and whys for this. I already have demonstrated workaround and until this gets implemented in the next release there is not need to dig it up further on our side. Yes we can overwrite the library files and fix it, but then it will brake on the next release. So it is better to do a simple workaround in the implementation until the core gets fixed.
I am not questioning that you have reported this to the dev team, just following up on the conversation.
You found a bug! We've classified it as
EXTJSIV-5521
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote