PDA

View Full Version : Duplicate reference warning on lookup method after component is destroyed.



dsanabria
9 Feb 2018, 2:24 PM
References are still present after the component is destroyed. After it is destroyed, I look up the reference to that window and it should not be present, but it comes up. Once a component is destroyed, the reference should also be destroyed to not create this problem.

ErikJAX
12 Feb 2018, 4:11 AM
I am now seeing the same issue on a modern project that uses the navigation view. I looked at the class structure after the view is removed with POP and it does appear to be removed from the parent container but it is still referenced somewhere.

The app still appears to function correctly but throws constant duplicate reference errors.

I do not have this issue in classic.

If you find a resolution please post results.

Erik

grosst
13 Feb 2018, 11:03 AM
I am now seeing the same issue on a modern project that uses the navigation view. I looked at the class structure after the view is removed with POP and it does appear to be removed from the parent container but it is still referenced somewhere.

The app still appears to function correctly but throws constant duplicate reference errors.

I do not have this issue in classic.

If you find a resolution please post results.

Erik


That's because it's lingering in the panel..

If you add an item w/ a reference it stays there


var addPanel = Ext.widget('panel',{
reference: 'addedPanel'
});

// add to panel

panel.add(addPanel);

var refs = panel.getReferences(); // should log addedPanel


//refs.addedPanel would be there




So you'd need to remove that reference from the panel before adding it again. Or if you don't need the reference, and are reusing a panel multiple times by destroying and re-adding, then I'd probably remove the reference from the item and then you wouldn't have any warnings.

Hope that makes sense.