PDA

View Full Version : [OPEN] Fields in CompositeField dont work findParentByType() ...



ToxSox
10 Feb 2011, 5:09 AM
Ext version tested:


Ext 3.3.1



Adapter used:


ext



css used:


only default ext-all.css





Browser versions tested against:


FF3 (firebug 1.6.2 installed)



Operating System:


Win7 Pro



Description:


If Fields in the Composite Field has Listeners ans use findParentByType function, the result is null.



Test Case:



Ext.onReady(function () {
var form = new Ext.form.FormPanel({
renderTo: 'docbody',
title: 'Composite Fields',
autoHeight: true,
items: [{
xtype: 'compositefield',
fieldLabel: 'Date Range',
items: [{
xtype: 'textfield',
name: 'aaa',
listeners: {
'change': function (textfield, newValue, oldValue) {
var panel = textfield.findParentByType('panel');
panel.destroy();
}
}
}]
}, {
xtype: 'textfield',
name: 'bbb',
listeners: {
'change': function (textfield, newValue, oldValue) {
var panel = textfield.findParentByType('panel');
panel.destroy();
}
}
}]
});
});
See this URL : http://www.tsojka.com/ext-3.3.1-bug/bug/composite-field.html


Steps to reproduce the problem:


change the value in the first textfield and blur -> nothing is done
change the value in the secound textfield ( is without Composite ) -> Panel destroy()



The result that was expected:


i expect that that in both textfields the panel was destroyed.



The result that occurs instead:


the first destory dont work because panel was not found.



Debugging already done:


the findParentByType function try to go on top by the ownerCt value. But in the Composite Container the owserCt value is undefined.



Possible fix:


delete in the ComposideField class the line:
this.innerCt.ownerCt = undefined;
which is after
this.innerCt = new Ext.Container({
layout : 'hbox',
items : this.items,
cls : 'x-form-composite',
defaultMargins: '0 3 0 0',
ownerCt: this
});

ToxSox
18 Feb 2011, 4:41 AM
Whats up?

ToxSox
21 Mar 2011, 2:02 AM
I think that is a big bug!