{ "id": "108321", "key": "ALOY-476", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14634", "description": "Alloy 1.0.0", "name": "Alloy 1.0.0", "archived": false, "released": true, "releaseDate": "2013-02-19" }, { "id": "14871", "description": "2013 Sprint 02", "name": "2013 Sprint 02", "archived": true, "released": true, "releaseDate": "2013-01-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-01-24T20:44:06.000+0000", "created": "2013-01-21T19:41:46.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "alloy", "bind", "bindings", "model", "view", "widgets" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-07T22:25:48.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12333", "name": "Widgets" } ], "description": "This:\r\n\r\n{code}\r\n\r\n\t \r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nResults in the following binding callback:\r\n\r\n{code}\r\nvar __alloyId10 = function(e) {\r\n\tvar models = Alloy.Collections.tip.models, len = models.length, rows = [];\r\n\tfor (var i = 0; i < len; i++) {\r\n\t\tvar __alloyId5 = models[i];\r\n\t\t__alloyId5.__transform = {};\r\n\t\tvar __alloyId6 = A$(Ti.UI.createTableViewRow({\r\n\t\t\tid: \"__alloyId4\"\r\n\t\t}), \"TableViewRow\", null);\r\n\t\trows.push(__alloyId6);\r\n\t\tvar __alloyId7 = Alloy.createWidget(\"nl.fokkezb.cachedImageView\", \"widget\", {\r\n\t\t\tid: \"profileImageView\",\r\n\t\t\timage: typeof $model.__transform.image != \"undefined\" ? $model.__transform.image : $model.get(\"image\"),\r\n\t\t\t$model: __alloyId5\r\n\t\t});\r\n\t\t__alloyId7.setParent(__alloyId6);\r\n\t\tvar __alloyId9 = A$(Ti.UI.createLabel({\r\n\t\t\twidth: Ti.UI.SIZE,\r\n\t\t\theight: Ti.UI.SIZE,\r\n\t\t\tcolor: \"#000\",\r\n\t\t\ttext: typeof __alloyId5.__transform.name != \"undefined\" ? __alloyId5.__transform.name : __alloyId5.get(\"name\"),\r\n\t\t\tid: \"__alloyId8\"\r\n\t\t}), \"Label\", __alloyId6);\r\n\t\t__alloyId6.add(__alloyId9);\r\n\t}\r\n\t$.__views.table.setData(rows);\r\n};\r\n{code}\r\n\r\nLeading to:\r\n\r\n{code}\r\n[ERROR] Script Error = 'null' is not an object (evaluating '$model.__transform') at index.js (line 25).\r\n{code}\r\n\r\nNote the difference between lines 12 and 20 of the callback. It looks like {{$model}} must be {{__alloyId5}} in this specific case, since that refers to the model.", "attachment": [], "flagged": false, "summary": "Widgets within model-bound view get bound to unexisting $model", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Mac OS X Mountain Lion 10.8.2\r\nTitanium Studio, build: 3.0.1.201212181159\r\nAlloy 0.3.6\r\nTiSDK 3.0.0.GA", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }