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
4 Answers
-
Hey Mark,
Pretty sure that's not possible in a modal. You might be able to work around it by something similar to what Kosso suggested here:
-
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
-
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.
-
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