Titanium Community Questions & Answer Archive

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

Modal window not working

I am having a really hard time trying to get any of the modal windows to work in my app. I have copied the code exactly from Kitchen Sink, and it still does not work.

Here is the code I'm trying to use:

var adView = Ti.UI.createButton({
    title:'Button',
    width:320,
    height:60,
    opacity:1.0,
    left:0,
    top:400
});

adView.addEventListener('click', function()
{

    var w = Titanium.UI.createWindow({
        backgroundColor:'#336699'
    });

    // create a button to close window
    var b = Titanium.UI.createButton({
        title:'Close',
        height:30,
        width:150
    });
    w.add(b);
    b.addEventListener('click', function()
    {
        w.close();
    });

    w.open();
});

win1.add(adView);

When I click on the button, it does nothing. What am I doing wrong?

— asked July 20th 2010 by Travis Moore
  • button
  • iphone
  • modal
  • window
0 Comments

1 Answer

  • Accepted Answer

    w.open({modal:true});
    
    — answered July 20th 2010 by Daniel Lim
    permalink
    1 Comment
    • I've tried that, but it also did not work. If that were the case, wouldn't the kitchen sink example need to have that also? It works without that somehow.

      — commented July 20th 2010 by Travis Moore
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.