I have many TabPanels in my application with each displaying a number of Panels. Most of the Panels contain various buttons (created using a custom function) and some have panels themselves (henceforth called sub-panels) containing HTML text displaying some value. On some of these Panels with sub-panels I have a function being called by the OnDraw event that attempts to hide or show the sub-panel based on a value being pulled from the server by a custom function. These sub-panels have an associated button above them on the Panel that toggles the value that their visibility is based on. All these Panels handle their appropriate sub-panels correctly, either hiding or showing them. The funky stuff happens when the sub-panel's associated button is clicked. When the Panel is the first one displayed when opening the TabPanel, clicking the button subsequently hides or shows the associated sub-panel. However, if the Panel is one in the Tab Panel that isn't displayed first, when clicking the button, it only hides or shows the associated sub-panel if the value is true when first viewing the Panel. If the value was false when opening the Panel, toggling the value with the button does nothing to show and then hide again the associated sub-panel. I am very confused with this and I hope my explanation isn't as confusing. Here is some of the code:

Code:
DevicePanels.getConveyorConfig = function(deviceName){
        return new Ext.Panel({
        title: 'Config',
        layout: {
            type: 'vbox',
            pack: 'center',
            align: 'center'
        },
        scroll: 'vertical',
        defaults:{
            width: HelmWeb.settings.PanelWidth
        },
        items:[
            base.view.getHMIToggleButton('btnToleranceWarningEnabled', 'Tolerance Warning Enabled',
                'MC2:' + deviceName + '.ToleranceWarningEnabled', 'MC2:' + deviceName +
                '.ToleranceWarningEnabled', 'green', 'DeviceToleranceEdit'), 
            {
                xtype: 'panel',
                id: 'DeviceToleranceWarningAmount',
                layout: {
                    type: 'vbox'
                },
                defaults:{
                    width: HelmWeb.settings.PanelWidth
                },
                items: [
                    {
                        html:
                        "<div onclick=\"DevicePanels.SetValuePrompt('" + deviceName +
                        "','ToleranceWarning','DeviceFreeFallSettingsEdit')\" id='" + deviceName +
                        "\\ToleranceWarning' class='EditableValue'>Tol. Warning Amount:</div>"
                    }
                ],
                OnDraw: function () {
                    var Me = new HMIElement(deviceName + '\\ToleranceWarning');
                    if (Me) {
                        Me.DisplayText = "Tol. Warning Amount: " + hmi.GetTagValue('MC2:' + deviceName +
                            '.ToleranceWarning', "??") + " kg"; 
                    }
                    
                    var pnl = Ext.getCmp('DeviceToleranceWarningAmount');
                    if (pnl) {
                        var toleranceWarningEnabled = hmi.GetTagValue('MC2:' + deviceName +
                            '.ToleranceWarningEnabled', false)
                        if (toleranceWarningEnabled) {
                            if (pnl.isHidden()) {
                                pnl.show();
                            }
                        }
                        else {
                            if (pnl.isVisible()) {
                                pnl.hide()
                            }
                        }
                    }
                }
            }
        ]
    })
}


DevicePanels.getConveyor = function(deviceName, displayName){
    return new Ext.TabPanel({
        defaults: {
            cls: 'controlPanel'
        },
        dockedItems: [DevicePanels.getDescriptionToolbar(deviceName)],
        items: [
        DevicePanels.getConveyorControls(deviceName),
        DevicePanels.getConveyorConfig(deviceName), // If this comes first in the list of items, the hiding and
‚Äč                                                    // showing of the sub-panels work as expected.
        DevicePanels.getConveyorTimers(deviceName),
        DevicePanels.getConveyorJogs(deviceName),
        ]
    })
}