'Titanium.UI.currentWindow' [null] is not an object. at app.js?
This is what I got in the app.js and I got the bloody red screen with message "Result of expression 'Titanium.UI.currentWindow' [null] is not an object. at app.js ."
What do you think is wrong?
var table_data = [
{title:'item1', test:'sample.js'},
{title:'item2', test:'sample.js'},
{title:'item3', test:'sample.js'}
];
var tableview = Titanium.UI.createTableView({
data:table_data
});
Titanium.UI.currentWindow.add(tableview); //this is the line where the error is!
5 Answers
-
I just started Titanium today, but I think their is no active window yet. You made a view, but no window so the currentWindow method returns null
-
Let me answer this question myself..
There is no concept of currentWindow when you are on the app.js
the above snippet would have run fine if it were to be in a seperate js file which is accessed thru a createwindow method
-
So how do we add things to the main app.js?
I've always done by creating a Tab Group. How would we go about just adding buttons on the main page that would link to other pages with Tab groups?
-
eek I got a 404 and it told me to reload!
-
I just started Titanium today, but I think their is no active window yet. You made a view, but no window so the currentWindow method returns null