View Full Version : Ref not working for components in composite field

2 May 2011, 9:45 AM
I thought I should be able to use the 'ref' attribute for components within a composite field.

IE I think this should work any one have any ideas:

var f = new Ext.form.FormPanel({
console.log(f.textField, f.btnTest);

I have tried adding more '../' with no luck. Try the example for yourself. Should this work??????

2 May 2011, 10:02 AM
It seems broken for me as well...

2 Jul 2011, 9:07 AM
Anyone have any ideas?

Again I am running 3.2.1.

2 Jul 2011, 11:14 AM
It doesn't work in 3.2.1 but it does work in 3.3.1 and 3.4.0.

Seems to be this bit of code that does it:


ref works by following the ownerCt chain. A composite field isn't a container so it doesn't add ownerCt to its items and as a result ref won't work automatically. In 3.4.0 this is worked around by wrapping the items in an extra container within the composite field and faking the ownerCt on the container to point to the composite field. All the refs have an extra '../' added to them to make this work the way you'd expect.