I am getting an error Cannot read property '__transform' of null data binding issue.
The line of code of the corresponding error from the resources section:
text: "undefined" != typeof $model.__transform["topic"] ? $model.__transform["topic"] : $model.get("topic")
I assume that somehow the model is not getting referenced correctly. Here is my model code. It is in file chatThreadSQL.js in the models directory:
exports.definition = {
config: {
"columns": {
"uuid":"TEXT UNIQUE PRIMARY KEY",
"topic": "TEXT",
"created":"TEXT",
//"patient": "",
},
adapter: {
"type": "sql",
"collection_name": "chatThreadSQL_col",
// idAttribute tells Alloy/Backbone to use this column in
// my table as its unique identifier field. Without
// specifying this, Alloy's default behavior is to create
// and "alloy_id" field which will uniquely identify your
// rows in the table with a text GUID.
"idAttribute": "uuid"
}
},
extendModel: function(Model) {
_.extend(Model.prototype, {
// extended functions go here
}); // end extend
return Model;
},
extendCollection: function(Collection) {
_.extend(Collection.prototype, {
// extended functions go here
}); // end extend
return Collection;
}
};
I have verified that data is being inserted into sqlite3 using adb shell.
Here is my view definition, for view file chatHome.xml
<TableView dataCollection="chatThreadSQL" id="table2">
<TableViewSection>
<TableViewRow id="row" title="{topic}" onClick="openChats" model="{uuid}" backgroundSelectedColor="#000080">
<Label id="title" text="{topic}"/>
<Label id="date" text="{date}"/>
</TableViewRow>
</TableViewSection>
</TableView>
in controllers/chatHome.js, I have the following line at the top of my file:
var chatThreads = Alloy.Collections.chatThreadSQL;
Any pointers would be greatly appreciated!
Other Info:
Application type: mobile
Titanium SDK: 3.1.3
Platform & version: Android 4.
Host Operating System: Ubuntu 13.04