Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1297 in a recent build.
  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    12
    Vote Rating
    0
    btoc007 is on a distinguished road

      0  

    Default PR3 - Ext.tab.Panel (Returning false activeitemchange)

    PR3 - Ext.tab.Panel (Returning false activeitemchange)


    When returning false on activeitemchange on an Ext.tab.Panel the panel does not switch but the button on the tabbar is highlighted. This should not occur.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,824
    Vote Rating
    836
    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


    Thanks for the report.
    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 User
    Join Date
    Feb 2012
    Posts
    1
    Vote Rating
    0
    joaquinmag is on a distinguished road

      0  

    Default


    Hi,

    I'm having the same issue here.

    Where can I found the code to fix this?

    I don't have time to make a migration right now...

    Thanks,

    JoaquĆ­n.

  4. #4
    Sencha User
    Join Date
    Oct 2011
    Posts
    12
    Vote Rating
    0
    btoc007 is on a distinguished road

      0  

    Default This is still broken

    This is still broken


    Fix obviously did not work or regressed in the 2.0 release

  5. #5
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Reopening this issue. Can we get a test case so we can be sure it resolved your specific problem.

    Sencha Inc

    Jamie Avins

    @jamieavins

  6. #6
    Sencha User
    Join Date
    Oct 2011
    Posts
    12
    Vote Rating
    0
    btoc007 is on a distinguished road

      0  

    Default Sample failing component

    Sample failing component


    Code:
    Ext.define("SWENGLE.view.TabPanelTest", {
        extend: 'Ext.Panel',
        xtype : 'xswengle-view-tabpaneltest',
        config: {
            layout: 'fit',
            cls: 'swengle-view-tabpaneltest',
        },
        initialize: function() {
            this.callParent(arguments);
    
    
            this.titleBar = Ext.create('Ext.TitleBar', {
                docked: 'top',
                title: 'Test',
            });
            
            this.tabPanel = Ext.create('Ext.tab.Panel', {
                tabBar: {
                    docked: 'bottom',
                    ui: 'light'
                },
                listeners: {
                    activeitemchange: function(tabPanel, to, from, opts) {
                        return false;
                    },
                    order: 'before'
                },
                layout: {
                    animation: {
                        duration:0
                    }
                },
                items: [{
                    title: 'Tab 1',
                    html: 'Tab 1',
                    iconCls: 'user'
                },
                {
                    title: 'Tab 2',
                    html: 'Tab 2',
                    iconCls: 'search'
                }]
            });
            this.add([this.titleBar, this.tabPanel]);
        }
    });
    Tapping Tab2 will result in the button being highlighted in the tab bar.

  7. #7
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Perfect, thanks.

    Sencha Inc

    Jamie Avins

    @jamieavins

  8. #8
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    The following override should resolve the issue:

    Code:
    Ext.define('Ext.tabpanel.override', {
        override: 'Ext.tab.Panel',
        doTabChange: function(tabBar, newTab) {
            var oldActiveItem = this.getActiveItem(),
                newActiveItem;
            this.setActiveItem(tabBar.indexOf(newTab));
            newActiveItem = this.getActiveItem();
            return oldActiveItem !== newActiveItem;
        }
    });
    If I may also make a suggestion. Not sure if it was just for a test case, but we don't recommend using initialize in the manner presented. The use of initialize should almost always be to add additional listeners which you don't want to override in a configuration. Otherwise you should be using configs as much as possible. The test case would better be represented as follows:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <title>1297</title>
        <link rel="stylesheet" href="../../resources/css/sencha-touch.css"/>
        <script src="../../sencha-touch.js"></script>
        <script>
            Ext.application({
                launch:function () {
                    Ext.define("TabPanelTest", {
                        extend:'Ext.Panel',
                        xtype:'tabtest',
                        config:{
                            layout:'fit',
                            cls:'swengle-view-tabpaneltest',
                            items:[
                                {
                                    xtype:'titlebar',
                                    docked:'top',
                                    title:'Test'
                                },
                                {
                                    xtype:'tabpanel',
                                    tabBar:{
                                        docked:'bottom',
                                        ui:'light'
                                    },
                                    listeners:{
                                        activeitemchange:function (tabPanel, to, from, opts) {
                                            return false;
                                        },
                                        order:'before'
                                    },
                                    layout:{
                                        animation:{
                                            duration:0
                                        }
                                    },
                                    items:[
                                        {
                                            title:'Tab 1',
                                            html:'Tab 1',
                                            iconCls:'user'
                                        },
                                        {
                                            title:'Tab 2',
                                            html:'Tab 2',
                                            iconCls:'search'
                                        }
                                    ]
                                }
                            ]
                        }
                    });
                    Ext.Viewport.add({ xtype:'tabtest'});
                }
            });
        </script>
    </head>
    <body></body>
    </html>
    Last edited by Jamie Avins; 27 Mar 2012 at 1:45 PM. Reason: Updated override

    Sencha Inc

    Jamie Avins

    @jamieavins

  9. #9
    Sencha User
    Join Date
    Oct 2011
    Posts
    12
    Vote Rating
    0
    btoc007 is on a distinguished road

      0  

    Default Conditional in config

    Conditional in config


    While I understand why using config, I would ask this question to see what you would recommend. Say I have a panel whose html is set differently based a some global variable. A good example is say you want to display some html that is different based on the fact that a user is signed in. How would you accomplish this using the config?

    in pseudo:

    if (user_is_logged_in) {
    setHtml('Welcome user');
    } else {
    setHtml('Come on now, let me know who you are');
    }

  10. #10
    Sencha User
    Join Date
    Oct 2011
    Posts
    12
    Vote Rating
    0
    btoc007 is on a distinguished road

      0  

    Default Fix does not quite work

    Fix does not quite work


    Cannot go back to the first tab