Open New Window From Picker?

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

Hi there, I am developing an application at the moment and I am trying set up a picker in which users can select an option and it takes them to a page appropriate to their choice. However I am having trouble opening the selected page, can someone help!

Here is my code:

var picker = Ti.UI.createPicker();
 
var data = [];
data[0]=Ti.UI.createPickerRow({title:'Test1', url:'Test1.js'});
data[1]=Ti.UI.createPickerRow({title:'Test2', url:'Test2.js'});
 
picker.add(data);
 
picker.addEventListener('click',function(evt)
    {
            var window = Titanium.UI.createWindow({url:evt.row.url, backgroundColor:'#fff'});
 
            var button = Titanium.UI.createButton({title:'Back'});
 
            win.leftNavButton= button;
 
            button.addEventListener('click', function()
        {
            win.remove(window);
            win.leftNavButton = null;
 
        });
 
    });
 
win.add(picker);

— asked 2 years ago by Sam Jacob
0 Comments

1 Answer

Dont worry I got there myself!

— answered 2 years ago by Sam Jacob
answer permalink
2 Comments
  • What did you have to do? I'm stuck with the same issue at the moment. thanks!

    — commented 2 years ago by Dusty Jump

  • Hi Dusty,

    Sorry for the late reply, In the end I just ended up creating a styled table view and set up links to the appropriate windows. If your still stuck, after all this time, you could always try that

    Thanks Sam

    — commented 2 years ago by Sam Jacob

Your Answer

Think you can help? Login to answer this question!