If I dynamically add an initially invalid text field into a hidden container and then show the container, the error icon is not displayed.
Looks like the problem is in the function "onLabelRender". I think it should actually unhide errorWrapEl after calling setVisibilityMode.



Code:
    onLabelRender: function() {
        ...
        if (errorWrapEl) {
            errorWrapEl.setVisibilityMode((me.msgTarget === 'side' && !me.autoFitErrors) ? ExtElement.VISIBILITY : ExtElement.DISPLAY);
            // here
        }
Here's the code:
Code:
Ext.create('Ext.Panel', {
    title : 'Contact Info',
    width : '100%',
    bodyPadding : 10,
    renderTo : Ext.getBody(),
    items : [ {
        xtype : 'form',
        width : 400,
        bodyPadding : 10,
        itemId : 'box_test',
        hidden : true,
        title : 'box_test',
        items : []
    }
    , {
        xtype : 'button',
        text : '1. add dynamically',
        handler : function(button) {
            var box_root = button.up();
            console.log('box_root: ' + box_root);
            var box_test = box_root.getComponent('box_test');
            console.log('box_test: ' + box_test);
            var myfield = Ext.create('Ext.form.field.Text', {
                itemId : 'myfield',
                name : 'name',
                fieldLabel : 'Name1',
                msgTarget : 'side',
                allowBlank : false
            // requires a non-empty value
            });
            box_test.add(myfield);
        }
    }
    , {
        xtype : 'button',
        text : '2. markInvalid',
        handler : function(button) {
            var box_root = button.up();
            console.log('box_root: ' + box_root);
            var myfield = box_root.query('[itemId=myfield]')[0];
            console.log('myfield: ' + myfield);
            console.log('myfield.errorWrapEl: ' + myfield.errorWrapEl);
            myfield.markInvalid('some message');
        }
    }
    , {
        xtype : 'button',
        text : '3. Unhide',
        handler : function(button) {
            var box_root = button.up();
            console.log('box_root: ' + box_root);
            var myfield = box_root.query('[itemId=myfield]')[0];
            console.log('myfield.errorWrapEl: ' + myfield.errorWrapEl);
            var box_test = box_root.getComponent('box_test');
            console.log('box_test: ' + box_test);

            box_test.setHidden(false);
        }
    }
    ]
});