1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    11
    Vote Rating
    0
    ipastine is on a distinguished road

      0  

    Default NavigationView: [ERROR]Setting activeItem to be a non-inner item

    NavigationView: [ERROR]Setting activeItem to be a non-inner item


    I'm probably doing something stupid, but I really have no idea what. Using the RC version of Sencha 2 I'm modifying the CityBars sample (using Designer, but I don't think that is the issue) to learn how to use the NavigationView. I've created a test view but when I push it to the Navigation view I get an error:

    Uncaught Error: [ERROR][Ext.Container#setActiveItem] Setting activeItem to be a non-inner item
    sencha-touch-all-debug.js:25192

    I've added a button push event to the Businesses controller in the sample with the following code:

    ============== start code =============
    if (!this.testContainer) {
    this.testContainer = Ext.create('CityBars.view.TestContainer', {title: 'Test'
    });
    }
    this.getMainNav().push(this.testContainer);

    ======== end code =============
    The error occurs on the final line. But if I change it to:


    this.getMainNav().push({
    title: 'Second',
    html: 'Second view'
    });

    then there is no problem and a new view is created and shown. But the problem does still occur if I create my custom view in the push method. So it seems to me that there is something wrong with my view:

    ============== start code -- first view file =============
    Ext.define('CityBars.view.TestContainer',
    { extend: 'CityBars.view.ui.TestContainer',
    initialize: function() {
    var me = this;
    me.callParent(arguments);
    }
    });

    ===================== second view file =============
    Ext.define('CityBars.view.ui.TestContainer',
    { extend: 'Ext.Container',
    config: {
    border: 20,
    centered: true,
    id: 'testContainerView',
    layout: {
    type: 'vbox'
    },
    items: [{
    xtype: 'label',
    border: 20,
    html: 'The TestContainer'
    }]
    }
    });
    ======================== end code ===============

    I've also tired creating my view with 'CityBars.view.ui.TestContainer' but with the same results. In both cases the object is created but push does not like it.

    I must be missing something really basic. Any help would be greatly appreciated.

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


    I'm simply using this to test:

    Code:
    Ext.create('Ext.navigation.View', {
        fullscreen : true,
        items      : [
            {
                title : 'Root',
                items : [
                    {
                        xtype   : 'button',
                        text    : 'Add',
                        handler : function(btn) {
                            var view = btn.up('navigationview');
    
                            var cmp = new Ext.Container({
                                html  : 'Hello',
                                title : 'Works'
                            });
    
                            view.push(cmp);
                        }
                    }
                ]
            }
        ]
    });
    Everything works fine there so you can indeed pass an already instantiated component.

    Does it work the first time but not the second time in your code?
    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
    11
    Vote Rating
    0
    ipastine is on a distinguished road

      0  

    Default


    I've been doing some poking around with it, and it seems to have some something to do with the CityBars project (or some modification I made to it in my ignorent experimentation).

    If I start a new project and take the same steps everything works fine. So I'm willing to just chalk this up to one of those things and get on with development if it doesn't reoccur in a different context.

    However, in case anyone runs into a similar issue, there is one additional symptom. If I make my custom view the initial view it comes up disabled -- it is greyed out and buttons won't react to taps (their code doesnt get fired but also their pressed andimation does not happen) etc. I would guess that this is related to the error.

    But I don't get this with a new project either. Weird, but not a problem as long as it doesn't reappear. I could send you the test project if you want to follow it up, but from my perspective there is no need.

    Thanks for your help.

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Location
    Vancouver, Canada
    Posts
    29
    Vote Rating
    1
    trevorcox is on a distinguished road

      0  

    Default


    I had the same problem he did, but the error went away if I removed
    centered: true,


Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi