JorisA
26 Dec 2007, 9:38 AM
If you have a look at this function (Ext.form.Field) you can see that Ext automatically generates a field name:
onRender : function(ct, position){
Ext.form.Field.superclass.onRender.call(this, ct, position);
if(!this.el){
var cfg = this.getAutoCreate();
if(!cfg.name){
cfg.name = this.name || this.id; // <--- this line
}
if(this.inputType){
cfg.type = this.inputType;
}
this.el = ct.createChild(cfg, position);
}
[ ... etc ]
That looks pretty unlogical to me, and I cannot really see any case where this would come in handy (If I want a field, I supply a name).
For example when you've got a editor grid inside a FormPanel it will also post the values of the field editors (which doesn't make any sense). Also fields like confirm email address, where I don't specify a name get submitted anyway.
I know this could be done using Ext.override, but I prefer to have this fixed in the lib. What do you guys think?
onRender : function(ct, position){
Ext.form.Field.superclass.onRender.call(this, ct, position);
if(!this.el){
var cfg = this.getAutoCreate();
if(!cfg.name){
cfg.name = this.name || this.id; // <--- this line
}
if(this.inputType){
cfg.type = this.inputType;
}
this.el = ct.createChild(cfg, position);
}
[ ... etc ]
That looks pretty unlogical to me, and I cannot really see any case where this would come in handy (If I want a field, I supply a name).
For example when you've got a editor grid inside a FormPanel it will also post the values of the field editors (which doesn't make any sense). Also fields like confirm email address, where I don't specify a name get submitted anyway.
I know this could be done using Ext.override, but I prefer to have this fixed in the lib. What do you guys think?