Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User ggendre's Avatar
    Join Date
    Feb 2012
    Location
    Lannion, France
    Posts
    24
    Vote Rating
    0
    ggendre is on a distinguished road

      0  

    Default setActiveItem on navigationView does not change the title

    setActiveItem on navigationView does not change the title


    hi,
    In the senchatouch2 final version, the setActiveItem method of navigationView is not properly changing the title of its navigationBar.

    see code below :

    Code:
    Ext.application({
        name:'myApp',
        launch:function () {
            var view = Ext.create('Ext.NavigationView', {
                fullscreen:true,
                items:[
                    {
                        id:'mySecondView',
                        title:'Second',
                        html:'Second view!'
                    },
                    {
                        title:'First',
                        items:[
                            {
                                xtype:'button',
                                text:'show the other view!', handler:function () {
                                view.setActiveItem('mySecondView');
                            }                        }
                        ]                }
                ]        });
            Ext.Viewport.add(view);
        }
    });
    When I hit the "back" button the title change.
    when I push views, the title change.
    but setActiveItem does not change it.

    Why ?
    Is there a workaround ?
    Thanks
    Last edited by ggendre; 9 Mar 2012 at 6:02 AM. Reason: code presentation was broken

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


    You should use push and pop to navigate through the navigation view.
    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 ggendre's Avatar
    Join Date
    Feb 2012
    Location
    Lannion, France
    Posts
    24
    Vote Rating
    0
    ggendre is on a distinguished road

      0  

    Default


    Okay for the pop() and push() but I don't want to re-create my view.

    The documentation is saying I can use setActiveItem to change between existing views.

    I think the title should change, and that's probably a bug, don't you ?

    The title was changing before beta 3 and is not changing since RC...

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,004
    Vote Rating
    847
    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


    setActiveItem is inherited. If you use setActiveItem you are not using navigation view the way it is intended. It is intended for push and pop to be used.
    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 User
    Join Date
    Jan 2012
    Posts
    19
    Vote Rating
    0
    tdekoekkoek is on a distinguished road

      0  

    Default


    But if you are trying to go directly to a view and don't know which one is currently active, you will want to use setActiveItem(). Just saying this is not the intended use does not answer the question. You cannot anticipate every application requirement. setActiveItem should work as specified and the title should be set correctly. Is there a workaround?

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,004
    Vote Rating
    847
    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


    In 2.1.0 we will be able to use ComponentQuery to figure out what to pop to meaning you can pass a selector and it will figure out what view to pop to making it the active item. The title is based on using push or pop
    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 User Frank's Avatar
    Join Date
    Mar 2007
    Posts
    185
    Vote Rating
    1
    Frank is an unknown quantity at this point

      0  

    Default


    As mitchellsimoens said, do not recommend using setActiveItem(), because setActiveItem() will destroy the structure of navigation.
    Ext Every Day!
    ajaxjs.com

  8. #8
    Sencha User Frank's Avatar
    Join Date
    Mar 2007
    Posts
    185
    Vote Rating
    1
    Frank is an unknown quantity at this point

      0  

    Default


    As mitchellsimoens said, do not recommend using setActiveItem(), because setActiveItem() will destroy the structure of navigation.
    Ext Every Day!
    ajaxjs.com