I am using multiple window apps being controlle via Tabgroup. I am using .js files for each window which are passed as URL with each window. I also have a function.js file where I am writing routines for reusable code;for instance Form generation or table View etc. Now I got stuck in a situation where I have to call a function which generates form element which are in WindowA. In WindowA I explicitly defined all required form elements. Now what do I pass in my function routine that it gets the reference of already created form element.
Please note that TableView created in separate Window, say WinB and I am generating rows by calling a routine written in functions.js. Ia m getting undefined error despite of variables are global in WinA.
How can I get the reference of those variables in entire application?
I highly recommend NOT using Ti.App to pass variables - even if it works. It is not best practice. I know you won't want to, but Take the time refactoring your code to not use windows with urls - go to a single instance / commonJS approach.
See https://wiki.appcelerator.org/display/guides/Mobile+Best+Practices and https://wiki.appcelerator.org/display/guides/CommonJS+Modules+in+Titanium
Also see https://github.com/appcelerator-titans/App for current best practice code.
It will take a while to refactor, but you app will be much more stable, and your code will be much cleaner.