View Full Version : <fieldset>
mharting
09-04-2007, 04:11 PM
When trying to use a form and using the fieldset tag i receive the following error from the ext-all.js file
in ie...
line 188
Error: 'this.el.dom.value.length' is null or not an object.
in firefox...
loading document runs and runs.
Thanks for all you do.
mth96a
09-04-2007, 04:44 PM
Have you loaded firebug in firefox, it is a great tool to debug web problems
mharting
09-05-2007, 10:02 AM
Yes i am using firebug
Here is the error as shown in firefox.
this.el.dom.value has no properties
Field()ext-all.js (line 188)
Field(Object dom=form#ext-gen106 id=ext-gen106 visibilityMode=1, null)ext-all.js (line 188)
ComponentMgr(form#ext-gen106 Address, undefined)ext-all.js (line 104)
Field(fieldset#ext-gen208.x-form-field)ext-all.js (line 188)
convertFields()extnd-all.js (line 147)
Form()extnd-all.js (line 142)
(no name)()Address (line 21)
Observable()ext-all.js (line 16)
EventManager()ext-all.js (line 18)
[Break on this error] Ext.form.Field=function(_1){Ext.form.Field.superclass.constructor.call(this,_1);...
becomcs
09-05-2007, 03:30 PM
first in forms.js the render function could be improved by catching errors and sent error message to prevent this in the future
replace
this.buildLayout();
this.convertFields();
msg.hide();
by
try {
this.buildLayout();
this.convertFields();
} catch(e) {
// Here send error message
}
msg.hide();
moreover the current issues came, for me, from two case:
FIELDSET are processed as common form field
ext-gen form fields are processed as any other fields
to prevent this i tunned extnd Form convertFields methode source code as follow
convertFields: function() {
var dh = Ext.DomHelper;
// handle xnd-* classes
var el, arClasses, cls;
var q = Ext.DomQuery;
if (this.bConvertFields) {
//var xndElements = q.select('*[class*=xnd-]');
var xndElements = this.form.elements;
var converted;
for (var i=0; i<xndElements.length; i++) {
el = xndElements[i];
// to ignore ext generated elements
if (el.id.slice(0,7) != 'ext-gen' || ( el.id != '' && el.name != '' ) )
{
converted = false;
arClasses = el.className.split(' ');
// check classes first
for (var c=0; c < arClasses.length; c++) {
cls = arClasses[c];
// to ignore specific forms items processed by ext
if ( cls.length >= 7 && cls.slice(0,7) == 'x-form-')
{
converted = true;
} else
{
switch (cls) {
case 'xnd-combobox' :
convertSelectToComboBox(el);
converted = true;
break;
case 'xnd-date' :
var dt = new Ext.form.DateField({
selectOnFocus : true
});
dt.applyTo(el);
converted = true;
break;
default :
break;
} // end switch(cls)
}
} // end for arClasses
// if the field did not have a 'xnd-' class then try to convert it based off of the tagName or type
if (!converted) {
switch(el.tagName) {
// to ignore fieldset items
case'FIELDSET':
break;
case 'SELECT' :
convertSelectToComboBox(el);
converted = true;
break;
case 'TEXTAREA' :
var ta = new Ext.form.TextArea({
resizable: true
});
ta.applyTo(el);
break;
case 'INPUT' :
var type = el.getAttribute('type');
switch(type) {
case 'hidden' :
break;
case 'checkbox' :
//var ckb = new Ext.form.Checkbox();
//ckb.applyTo(el);
break;
default :
var f = new Ext.form.Field();
f.applyTo(el);
break;
} // end switch(type)
default :
var f = new Ext.form.Field();
f.applyTo(el);
break;
} // end switch(el.tagName)
} // end !converted
} // end el.id.slice(0,7) != 'ext-gen'
} // end for xndElements
} // if this.bConvertFields
mharting
09-06-2007, 08:33 AM
I think you got it!! Thanks
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.