Empty Window in TableView when fast re-opening

You must Login before you can answer or comment on any questions.

Hi,

I am quite new to Titanium Mobile, but I didn't find an answer to my problem in the Q&A.

I have a tab in a tabView with an tableView:

var win = Ti.UI.currentWindow;
var data = [
    {title: 'Anfahrt', hasChild: true, childPage: "services/anfahrt.js"},
    {title: 'Notfall-Nummern', hasChild: true, childPage: 'services/notfall.js'}
];
var table = Ti.UI.createTableView({data: data});
 
table.addEventListener('click', function(e)
{
    if (e.rowData.childPage)
    {
        var child = Titanium.UI.createWindow({
        url:e.rowData.childPage,
        title:e.rowData.title,
        backgroundColor: '#fff'
    });
    Titanium.UI.currentTab.open(child,{animated:true});
    }
});
 
win.add(table);
My notfall.js contains some labels and a reverse geolocation.

So, now to my problem (iPhone iOS 4.1): The first time I open the window, it opens without any problem. If I Jump back via the navigation bar and open the window again without waiting I get an empty window. When I wait about 2-3 seconds then there is now problem.

Any Ideas and thank you.

2 Answers

this statement

Titanium.UI.currentTab.open(child,{animated:true});
should be inside the if (e.rowData.childPage) block since you are defining child in that scope

I must apologize - it was a stupid error. In my child page I defined var win = Ti.API.currentWindow not Ti.UI.currentWindow and added my labels to win. This resulted in a strange behaviour. I must say, the currentWindow method is not named in the documentation of API-class.

Your Answer

This question has been locked and cannot accept new answers.