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();
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.
-
This forum is pretty sleepy.
So is this a bug or a feature?
Or should i go back to bed. zzzzz
-
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
-
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!
-
Was a bug lodged for this?
-
Can someone from Appcelerator provide two updates regarding this thread?
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.
What is the status of Appcelerator as a company? What is the status on getting applications iPhone/iTune apps approved?