Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (ti.app)
Viewing all articles
Browse latest Browse all 15

Ti.App Global Variables and Webviews = Null

$
0
0

Hi,

I have an application that quieries a sql database and assigns the results/fields to Ti.App variables so that they can be accessed from any other js file.

Whenever I open a window that contains a webview, these variables get set to 'null'

Has anybody encoutered this?

EDIT: Added Code

This is the code that queries the db and assigns the variables

//database connection is established before here
 
//Search the Database with the entered exhibit number
var rows = db.execute('SELECT * FROM content WHERE objectNum = ' + exhibitNumber);
 
//Put all fields into a variable
    var objectName = rows.fieldByName('objectName');
 
 
 
//assign variables to global holder.
Ti.App.objectName = objectName;
After this I have a js file that loads other js files into contained windows or webviews. Each of these windows/webviews calls what is stored in the Ti.App.variableName.

everything works fine until a webview is added. When I add a webview it loads its data (a html file name) and opens the html no problem. If go to another window after this all Ti.App variables are set to null.

If I don't go near any webviews the variables remain intact.


Viewing all articles
Browse latest Browse all 15


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>