PDA

View Full Version : Ext Bug or error in my method?



Tim Toady
27 Oct 2010, 1:23 PM
Hello,

I have a form with various fields on it. On the afterrender event of the form, I am calling setValues with my data. All the fields get filled in except the fields within the composite field. I tried using findField during the afterrender as well and it returned null.

Doing it with firebug finds the field if I wait until I can see that it is there visually. Is there another event that I can use instead of afterrender. I tried show but it doesnt work either (not to mention I only want to it to happen the first time).


EDIT--------------------------------------------
Seems to be caused by an override to fix a problem where Ext doesn't search inside radiogroups/checkgroups/composite fields. Looking to see if 3.3 fixed the issue it is trying to. Here is the override in question:



// add type flag to RadioGroup
Ext.override(Ext.form.RadioGroup, {
//private
isRadioGroup: true
});
// add type flag to CheckboxGroup
Ext.override(Ext.form.CheckboxGroup, {
//privates
isCheckboxGroup: true
});
//Override for finding fields in checkboxgroups or radiogroups
Ext.override(Ext.BasicForm, {
findField: function(id) {
var field = this.items.get(id);
if (!Ext.isObject(field)) {
//searches for the field corresponding to the given id. Used recursively for composite fields
var findMatchingField = function(f) {
if (f.isFormField) {
if (f.dataIndex == id || f.id == id || f.getName() == id) {
field = f;
return false;
} else if (f.isComposite && f.rendered) {
return f.items.each(findMatchingField);
} else if (f.isRadioGroup && f.rendered) {
return f.items.each(findMatchingField);
} else if (f.isCheckboxGroup && f.rendered) {
return f.items.each(findMatchingField);
}
}
};
this.items.each(findMatchingField);
}
return field || null;
}
});



SOLVED-------------------------------------------------
The issues the override was used to fix in my application appear to be working without the override. Removing the override solved my problem.