Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Huntsville
    Posts
    227
    Vote Rating
    -6
    mark0978 is infamous around these parts mark0978 is infamous around these parts

      0  

    Default tabpanel calls activate on non-active tabs during instantiation

    tabpanel calls activate on non-active tabs during instantiation


    There are 2 problems reported in this question. The primary question and the discovery that activate is called when a tab is created, even if that tab is NOT the activeTab.

    http://stackoverflow.com/questions/8...t-wont-display

    activate shouldn't be called unless the tab is being activated. During instantiation, when there is only one tab, it gets "activated". Problem is this should be delayed until after all the tabs are created and the activeTab config param is processed.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Can I get a test case?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Huntsville
    Posts
    227
    Vote Rating
    -6
    mark0978 is infamous around these parts mark0978 is infamous around these parts

      0  

    Default Offical Bug report

    Offical Bug report


    noteExt version tested:
    • Ext 4.07
    Browser versions tested against:
    • NA but: Chrome 15
    DOCTYPE tested against:
    • html
    Description:
    • Tab 2 is to be active when the panel is shown. Activate for panel one is called while instantiating the tabs.
    Steps to reproduce the problem:
    • Save code as html in folder with "ext-all-debug-w-comments.js"
    • load code below from filesystem
    • Set breakpoint where indicated by comment
    • reload code
    The result that was expected:
    • Activate is only called when the tab is activated
    The result that occurs instead:
    • Activate called on instantiation
    • Activate called on activation
    Test Case:
    Code:
        
    <!DOCTYPE html>
    <html>
    <head>
        <script src='ext-all-debug-w-comments.js' type='text/javascript'></script>
    </head>
    <body>
    
    
    <script type='text/javascript'>
    
    
    Ext.define('Viewer.ui.Viewport', {
        extend: 'Ext.container.Viewport',
    
    
        layout: {
            type: 'anchor'
        },
    
    
        initComponent: function() {
            var me = this;
            Ext.applyIf(me, {
                items: [
                    {
                        xtype: 'panel',
                        height: 80,
                        resizable: false,
                        html: "<img src='/static/img/logo.gif' height='40'>",
                        id: 'logo',
                        flex: 1,
                    },
                    {
                        xtype: 'tabpanel',
                        activeTab: 1,
                        items: [
                            {
                                xtype: 'panel',
                                loader: {
                                    url: '/viewer/welcome/',
                                    renderer: 'html',
                                    autoLoad: false
                                },
                                layout: {
                                    type: 'fit'
                                },
                                title: 'Welcome',
                                listeners: {
                                    activate: function(me, opts) {
                                         me.getLoader().load(); // breakpoint here to see spurious activate
                                    }
                                }
                            },
                            {
                                xtype: 'panel',
                                title: 'Today'
                            },
                            {
                                xtype: 'panel',
                                title: 'History'
                            },
                            {
                                xtype: 'panel',
                                title: 'Alerts'
                            },
                            {
                                xtype: 'panel',
                                title: 'Preferences'
                            }
                        ]
                    }
                ]
            });
            me.callParent(arguments);
        }
    });
    
    
    Ext.application({
        launch: function() {
            Ext.create('Viewer.ui.Viewport');
        }
    });
    </script>
    </body>
    <html>
    Last edited by mark0978; 14 Dec 2011 at 6:33 AM. Reason: Left out 2 steps

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Here is a better test case:

    Code:
            var activate = function(cmp) {
                console.log(cmp.title);
            };
    
            Ext.create('Ext.tab.Panel', {
                renderTo  : Ext.getBody(),
                width     : 400,
                height    : 400,
                activeTab : 1,
                title     : 'Activate Test',
                items     : [
                    {
                        title     : 'One',
                        html      : 'one',
                        listeners : {
                            activate : activate
                        }
                    },
                    {
                        title     : 'Two',
                        html      : 'two',
                        listeners : {
                            activate : activate
                        }
                    }
                ]
            });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Now, the problem is the tabpanel is always rendered with the first item active and then it does the setActiveItem on the activeTab
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Testing in our latest code which will be 4.1.0 beta 1 (the next release) and this is working 100% as expected. My test case, it only logs out 'Two'
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #7
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Huntsville
    Posts
    227
    Vote Rating
    -6
    mark0978 is infamous around these parts mark0978 is infamous around these parts

      0  

    Default


    Funny the "better" testcase was in the Stackoverflow post..... I thought you wanted something easier to see. Admittedly console.log was cool, but I figured you wanted the stack backtrace to see it was happening during instantiation, hence the breakpoint method.

Thread Participants: 1

Tags for this Thread