Titanium Community Questions & Answer Archive

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

close modal window and show results

Hi All

struggling again and sorry if this is simple. I have a function which when the phone is shaked a dialog window pops up. If selected OK it opens a modal window with a mapview and the all right pins show.

I now want to click the rightbutton and display the details in a new window. I have the eventlistener working with the right button and im tracing the anotation id which is also working.

mapview.addEventListener('click',function(evt)
{
    var annotation = evt.annotation;
    var clickSource = evt.clicksource;
    var myid = evt.annotation.myid;

    if (evt.clicksource == 'rightButton')
    {

    Titanium.API.info(myid);
    var win = Titanium.UI.createWindow({barColor:'#001336',url:'business_details_template.js',id: myid}); 
                win.bid = id;
    }

});

What i want to do is slide a new window from the right whilst in the modal window? is this possible?

Thanks in advanced

— asked April 5th 2010 by Mark Pierce
  • mapview
  • modal
  • ui
  • window
0 Comments

4 Answers

  • Hi Dan

    Thanks for the response. Have tried it and having played with it and done some mental models/user journeies, im thinking about another way to present this. So I now like the idea that the modal window close on rightbutton click and the new window is underneath populated.

    This is working except when i close the modal window with new window is there and populated for a split second and then disappears.

    var tw = Titanium.UI.createWindow({barColor:'#001336',url:'temp_business_details.js',id:myid}); 
    
    tw.open();
    Titanium.UI.currentWindow.close();
    

    How do I get the new window created to stay once the modal window has gone?

    thanks in advance

    — answered April 6th 2010 by Mark Pierce
    permalink
    0 Comments
  • Hey Mark,

    Are you able to post more of your code? Curious to see how exactly you're opening things, then I'll let you know if I can think of anything for you.

    — answered April 6th 2010 by Dan Giulvezan
    permalink
    0 Comments
  • Hi Dan

    sorry for my late response. On holiday with the wife and kids and only get small slots of time :)

    
    mapview.addEventListener('click',function(evt)
    {
        // map event properties 
        var annotation = evt.annotation;
        var title = evt.title;
        var clickSource = evt.clicksource;
    
        // custom annotation attribute
        var myid = evt.annotation.myid;
    
    
        if (evt.clicksource == 'rightButton')
        {
                Titanium.API.info(myid);
                var tw = Titanium.UI.createWindow({backgroundImage:'../images/background.png',barColor:'#001336',url:'temp_business_details.js',id:myid}); 
                tw.open();
                Titanium.UI.currentWindow.close();
        }    
    });
    

    any thoughts welcome. Hope its not school boy error stuff..

    thanks

    — answered April 8th 2010 by Mark Pierce
    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.