Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

NavigationGroup - Custom back button

Hello there. I've the following code on the app.js:
http://pastie.org/929639

And when I click in a certain menu button, it goes like this:
http://pastie.org/929641

The navigationgroup has the navbar hidden, because I did a custom one. So there I have a back button, but how am I supposed to make the navigationgroup go back? There is no such method on the docs. So far, what I tried to do (on the custom back button) is this:
http://pastie.org/929643

I did an output into to check if the 'currentWindow' var is correct and it is. But in the moment I click the app crash. So, how do I go back in a navgroup W/OUT using the regular back button?

— asked April 22nd 2010 by Carlos Costa
  • iphone
0 Comments

3 Answers

  • I am having the same issue. The default Navigation Button works fine but the custom one won't make the navigation go back. There seems to be a method missing.

    — answered January 26th 2012 by Leonardo Amigoni
    permalink
    1 Comment
    • OK. Seem to have figured it out. The close command has to be on the navgroup not on the window.

      var win = Ti.UI.createWin();
      var navGroup = Ti.UI.iPhone.createNavigationGroup({
          window:win
      });
      
      //Wrong
      win.close(); // This will only close the window.
      
      //Right
      navGroup.close(win); // This will close the window and go back.
      

      — commented January 26th 2012 by Leonardo Amigoni
  • Up! I've a question that complements mine: is there any "back" method from navigationgroup or even tabgroup? 'cause maybe I could convert to a tabgroup hiding the tabs.

    — answered April 22nd 2010 by Carlos Costa
    permalink
    0 Comments
  • when a window is a child of a tab, there is a 'back' button auto-created.
    You customise the back button with creating the main window using parameter like backButtonTitle, etc.

    — answered April 23rd 2010 by Peter Lum
    permalink
    1 Comment
    • Yes, works fine with tabs, but not with navigationGroups…

      — commented August 28th 2011 by Benoit Blais
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.