PDA

View Full Version : [DUPE][3.1] Fields with id or name of "id" cause unload error



johnmcteague
4 Feb 2010, 5:39 AM
Ext version tested:


Ext 3.1.0



Adapter used:


ext



css used:


only default ext-all.css





Browser versions tested against:


IE6
FF3.5



Operating System:


WinXP Pro



Description:


If I create a form panel (or modify the forms example file dynamic.js and reload the sample page) and give a component a name value of "id" or and id of "id", when the page is unloaded a javascript error ocurrs in IE6 but not FF3.
The error is "Object doesn't support method or property". The call stack is Ext.EventManager._unload()->Ext.EventManager.removeAll()->Ext.EventManager.getId()->Ext.id().

Debugging through it seems to be erroring when Ext.EventManager.removeAll() is called with the formPanel element.



Test Case:
I have simply modified dynamic.js, which is in the examples/form/ folder of the 3.1.0 distribution as follows:


var simple = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
url:'save-form.php',
formId:'foo',
frame:true,
title: 'Simple Form',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',

items: [{
fieldLabel: 'First Name',
name: 'id',
allowBlank:false
},{
fieldLabel: 'Last Name',
name: 'last'
},{
fieldLabel: 'Company',
name: 'company'
}, {
fieldLabel: 'Email',
name: 'email',
vtype:'email'
}, new Ext.form.TimeField({
fieldLabel: 'Time',
name: 'time',
minValue: '8:00am',
maxValue: '6:00pm'
})
],

buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});
Simply navigate away from the page and the error occurs.



Possible fix:


Dont call a field "id".

Jamie Avins
4 Feb 2010, 8:50 AM
This is already addressed in SVN for 3.1.1