Titanium Community Questions & Answer Archive

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

CreateNavigationGroup

Is it possible to use the url: part of the createWindow function with nav groups?
I tried something similar to the following and it failed to load the contents of my first_window_stuff.js file.

var baseWindow = Titanium.UI.createWindow({});

var win1 = Titanium.UI.createWindow({
url:’first_window_stuff.js’,
title:’First Title’
});

var nav = Titanium.UI.iPhone.createNavigationGroup({
    window: win1
});
baseWindow.add(nav);
baseWindow.open();
— asked June 16th 2010 by nobody anonymous
  • createnavigationgroup
  • iphone
  • navigation
0 Comments

6 Answers

  • Looks like we have a bug with nav group with an external URL. I will add a ticket if there is not one already, but in the meantime you can separate out the code to add logic to the child window using Ti.include. So in my example, app.js becomes:

    //Here's the first window...
    var first = Ti.UI.createWindow({
      backgroundColor:"#fff",
      title:"My App"
    });
    var label = Ti.UI.createLabel({ text: "poke me to open the next window" });
    first.add(label);
    
    //Here's the nav group that will hold them both...
    var navGroup = Ti.UI.iPhone.createNavigationGroup({
        window:first
    });
    
    //Here's a window we want to push onto the stack...
    var second = Ti.UI.createWindow({
      background:"#fff",
      title:"Child Window"
    });
    Ti.include("external.js");
    
    //When the label on the first window receives a touch, open the second
    label.addEventListener("click", function(e) {
      navGroup.open(second);
    });
    
    //This is the main window of the application
    var main = Ti.UI.createWindow();
    main.add(navGroup);
    main.open();
    

    And external.js contains:

    second.add(Ti.UI.createLabel({text:"Here's the child"}));
    

    Hopefully that helps. Also, we try and get to as many issues as we can (3 of the top 4 question answer-ers are Appcelerator employees), but of course we can and will continue to do better in this area. While Pro subscribers have the "hotline" to the Appcelerator crew, we also take supporting the community very seriously, since community members help out with Titanium in a variety of awesome ways. We're also working on ideas to further reward community participation to help more Q&A items get answered, docs improved, tutorials written, etc.

    — answered June 21st 2010 by Kevin Whinnery
    permalink
    1 Comment
    • Hi Kevin. I think I'm hitting this issue see this Q&A but the fix you suggest isn't working for me.. the included file baulks when it tries to reference the parent window.

      Could you take a look at the code I've posted and let me know if there's a way around it. I've posted all the code so that people can get a head start implementing this more complex navigation.

      — commented June 23rd 2010 by Matt Collinge
  • This forum is pretty sleepy.

    So is this a bug or a feature?

    Or should i go back to bed. zzzzz

    — answered June 18th 2010 by nobody anonymous
    permalink
    0 Comments
  • Zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.

    I feel your pain!

    I've been having trouble getting answers to any of my posts. Can't quite believe it, since when I used TM 0.8 in November last year it was an awesome resource.

    Now I'm getting next to nothing & am struggling to get basic stuff to work. Maybe it's a push to get you to upgrade to premium support.. but it makes me nervous that the support there will be poor as well…. anyone got any experience with the upgraded support option??

    Did you try Kevin's navGroup example? It works pretty well, but doesn't work under Android so not quite sure where to go from here.

    http://developer.appcelerator.com/blog/2010/06/how-to-create-an-iphone-navigation-group.html

    — answered June 21st 2010 by Matt Collinge
    permalink
    0 Comments
  • I did see Kevin's nav group example, but it didn't give offer examples on using the url parameter. I ended up concluding that it didn't work and probably wasn't going to in the near future so I just shifted all my code into the one file.

    My concern with the sleepyness of this forum is that perhaps the Appcelerator team are scaling down in the wake of the changes to the SDK terms. Still haven't heard anything to confirm that all is good on that front which is a big worry. I'm not really cashed up enough to be spending all my money on a titanium subscription either.

    I started my development on Android myself and discovered that the Android side of things lags behind quite a bit too.. Particularly on the performance front.. It's not really up to scratch. Plus the Q&A is mostly iphone developers too so it's hard to find any help.

    Well I just earned another point answering my own question again.. i'm up to 150 or so now!

    — answered June 21st 2010 by nobody anonymous
    permalink
    1 Comment
    • Yeah, it's a shame that ppl are concentrating a lot on the iPhone.. as a company we're targeting iPhone and Android with our releases, might as well get more bang for our development effort.. and to me that's the whole point of Titanium; to create apps for both platforms using one code base.

      — commented June 23rd 2010 by Matt Collinge
  • Was a bug lodged for this?

    — answered July 4th 2010 by Nick The Geek
    permalink
    0 Comments
  • Can someone from Appcelerator provide two updates regarding this thread?

    1. Has a bug been logged for this issue? I'm currently experiencing it with iPad / 4.0 / 1.4.1. The "url" parameter is only working for the main canvas window. If I try and use the URL for any "inner" windows, I get nothing.

    2. What is the status of Appcelerator as a company? What is the status on getting applications iPhone/iTune apps approved?

    — answered August 17th 2010 by Jag Lavek
    permalink
    0 Comments
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.