code in window - '.js' files executed when ?
I observed a strange behavior.
The app has a tabGroub with 3 window (in extra '.js' files).
In the main app.js i listen to events fired by those windows.
Titanium.App.addEventListener('onWindowInitialized', function(e){...});
At the end of every window.js files i fire that event.Titanium.App.fireEvent('onWindowInitialized');
Now the strange behavior:
When i start the simulator for the first time, only the first active window of the tabGroub fires.
But when i start the simulator again, all 3 windows fire the event.
Question:
Is the code in window.js files executed, when the tab is selected or when the tabGroup is created. Why is it inconsistent ?
1 Answer
-
Hi!
To my knowledge, the windows are only loaded on demand, so not until you focus them for the first time.
Are you sure each of the other windows are firing the event, and that it's not just some kind of logging issue?
If you addTitanium.App.fireEvent('onWindowInitialized', { name: "myWindow1" });
you'll see where it came from.
/Jacob