Titanium Community Questions & Answer Archive

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

tableview not opening new window

Hi All

I have this simplified code below which will display 1 table view row, and when the user selects that row the current window should animate to the left and reveal the newWin.js

Problem is it doesn't.

There are no tabs being uses in this window.

var win = Ti.UI.createWindow();

var data = [ {header:'myHeading', title:'open new window',  hasChild:true,  color:'#000000', selectedColor:'#808080', test:'newWin.js'} ];

var tableView = Titanium.UI.createTableView({ 
    data:data, 
    style:Titanium.UI.iPhone.TableViewStyle.GROUPED
});

tableView.addEventListener('click', function(e) {
    if (e.rowData.test) {
        var w = Titanium.UI.createWindow({
            url:e.rowData.test,
            title:e.rowData.title,
            backgroundColor:'#FFFFFF'
        });
        win.open(w,{animated:true});
    }
});

win.add(tableView);
win.open();

Am I doing something wrong here?

Thanks
Jamesy

— asked July 28th 2010 by Richard James
  • tableview
1 Comment
  • instead of
    win.open(w,{animated:true});

    use
    w.open({animated:true});

    — commented July 31st 2010 by Christian Sigl

2 Answers

  • This might help u

    http://www.pastie.org/1068433

    check it i have created with tabs i think u shd use like Titanium.UI.currentWindow.open(w,{animated:true}) statement, verify it

    — answered July 31st 2010 by Varun Atluri
    permalink
    0 Comments
  • please check this pastie too & inform me if u have any douts still

    http://www.pastie.org/1099675

    — answered August 19th 2010 by Varun Atluri
    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.