Skip to content

Latest commit

 

History

History

ep-006

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Episode 6: A Single Context Tab Group Template

In this week's episode, we'll be taking a look at how to implement a tab-based application in a single JavaScript context in Titanium Mobile. Throughout our reference guides and official training course, we generally advocate the use of a single JavaScript context in your Titanium applications.

However, in our most popular demo application, the Titanium Mobile Kitchen Sink, a tab-based application is developed using multiple contexts by associating each window opened with a URL to a JavaScript file. While this approach is technically valid, it presents the developer with difficulties around sharing data between windows, confusion around when code for a window has been executed, possible object reference issues which can lead to memory leaks, and reloading of JavaScript code in every window for shared libraries. For those reasons, unless you have a specific need for a "clean slate" in every window, using multiple JavaScript contexts cannot be considered a best practice approach to structuring a Titanium Mobile application.

What then would be a reasonable approach to structuring windows in a tabbed application? And how do we work around the loss of Ti.UI.currentTab and friends? Find out the answer in this week's episode of Forging Titanium.

Episode Resources: