View Full Version : onChange listener for RadioGroup

19 Apr 2011, 9:46 AM
Hi All,
I have a radiogroup, with 2 radio buttons, present inside a formpanel.

xtype: 'radiogroup',
name: 'myoptions',
originalValue: '',
items: [
{boxLabel: 'option1', name: 'option', inputValue: "1"},
{boxLabel: 'option2', name: 'option', inputValue: "2"}

My form panel is loaded from some external data.
I attach the onChange listener to the radiogroup, after the data is loaded on the form, and the value to one of the radio is set.
But some how, as soon as i attach the listener, it gets fired.
basically what i am trying to do it to restrict the firing of listener after the formpanel load.
I need to fire listener when the user actually tries to change the radio values, and the firing should not take place when i load the form panel.

Any ideas how can i achieve this ?


19 Apr 2011, 9:56 AM
Maybe you could set the listener in the 'success' block of the form load? This way the listener is only activated after the form load has completed.

19 Apr 2011, 10:05 AM
Thats what i tried, i even try to suspend all listeners, but no matter waht it is always being called, whenvever i resume or add it back to the radiogroup.