Appcelator Titanium : Calling a function of parentWindow from childWindow?

The easiest way to do it for your setup is to include it on both files Ti. Include('functions_files. Js') The other way you could do it is to define both windows in one file with the function and have the windows set to a url App.

Js var Appwin = Ti.UI. CreateWindow({ url: 'path/to/Win1. Js' }); var childWindow = Ti.UI.

CreateWindow({ url: 'path/to/Win2. Js' }); function checkPage() { } Appwin.open(); childWindow. AddEventListener('open', function() { checkPage(); }) As requested: Win1.

Js var Appwin = Ti.UI. CreateWindow({ }); Ti.App. AddEventListener('checkPage', function(e) { var tableView = e.

TableView; }); Appwin.open() Win2. Js var childWindow = Ti.UI. CreateWindow({ }); var tv = tableView; childWindow.

AddEventListener('close', function() { Ti.App. FireEvent('checkPage', { tableView = tv }); }).

The easiest way to do it for your setup is to include it on both files. Ti. Include('functions_files.

Js'); The other way you could do it is to define both windows in one file with the function and have the windows set to a url. App. Js var Appwin = Ti.UI.

CreateWindow({ url: 'path/to/Win1. Js' }); var childWindow = Ti.UI. CreateWindow({ url: 'path/to/Win2.

Js' }); function checkPage() { } Appwin.open(); childWindow. AddEventListener('open', function() { checkPage(); }); As requested: Win1. Js var Appwin = Ti.UI.

CreateWindow({ }); Ti.App. AddEventListener('checkPage', function(e) { var tableView = e. TableView; }); Appwin.open(); Win2.

Js var childWindow = Ti.UI. CreateWindow({ }); var tv = tableView; childWindow. AddEventListener('close', function() { Ti.App.

FireEvent('checkPage', { tableView = tv }); }).

I want to call the function on the close of the button – theJava Apr 19 at 16:31 Ti. Include('functions_files. Js'); is still your best bet.

Change the 'open' to 'close' and you're set. – bh88 Apr 19 at 17:18 you mean to say I need to include Win2. Js in Win1.js.... and use the function – theJava Apr 19 at 17:28 1 Nope.

Put your function in a file say functions. Js and then Ti. Include('functions.

Js'); in each of your files that need access to the function. – bh88 Apr 19 at 17:32 1 added as requested – bh88 Apr 19 at 18:24.

Var childWindow = Ti.UI. Var Appwin = Ti.UI. Var tableView = e.

Var childWindow = Ti.UI.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions