In iPhone when modal window dismiss so I am getting callback for 'focus' but in android focus is not called when modal window dismiss.
btn1.addEventListener('click',function(e){ var w = Titanium.UI.createWindow({ backgroundColor:'#FFFFFF', title:'Select Location', barColor:'black', barImage: '../images/bkg-header.png', url:'weather_cities.js', exitOnClose:true, }); w.open({modal:true}); w.addEventListner('close',function(e) { var mycity = Titanium.App.Properties.getString('City'); this.cityLabel.text = mycity; // unable to change cityLabel value }); });From Modal Window, which is opened from Parent Window.
var win = Titanium.UI.currentWindow; b.addEventListener('click',function() { setTimeout(function() { win.close(); }, 1000); win.addEventListener('close', function() { alert('Close event fired'); Ti.API.info('Close event fired'); Ti.API.debug(win); //var mycity = Titanium.App.Properties.getString('City'); //super.cityLabel.text = mycity; }); });
1 Answer
Accepted Answer
Hi Umaid,
Try to use fireEvent because in your code you use this which point your modal window not parent window.
Ti.App.addEventListener('updateText',function(e){ var mycity = Titanium.App.Properties.getString('City'); cityLabel.text = mycity; });fire this event from you modal window close event.
Ti.App.fireEvent('updateText');
Your Answer
Think you can help? Login to answer this question!