{ "id": "85374", "key": "TIMOB-7355", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12095", "description": "", "name": "Sprint 2012-03", "archived": true, "released": true, "releaseDate": "2012-02-12" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-02-14T23:28:59.000+0000", "created": "2012-01-24T11:33:56.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "regression" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-02-14T23:28:59.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Expected Results\r\n\r\nI should be able to read from e.row.children[] within a table's event listener. This works fine on iOS (simulator and my iPad running iOS5) and works with TiAPI 1.7.5/1.7.6 on Android. \r\n\r\nh2. Actual results\r\n\r\nCode below throws {{Uncaught TypeError: Cannot set property 'text' of undefined}}\r\n\r\n{code}\r\nvar table = Ti.UI.createTableView();\r\nfunction makeRow(num) {\r\n\tvar row = Ti.UI.createTableViewRow({\r\n\t\theight:60,\r\n\t\trowID: num\r\n\t});\r\n\trow.add(Ti.UI.createLabel({\r\n\t\tfont:{\r\n\t\t\tfontWeight:'bold',\r\n\t\t\tfontSize:16\r\n\t\t},\r\n\t\tleft:5,\r\n\t\ttop: 0,\r\n\t\ttext:'Row '+num\r\n\t}));\r\n\trow.add(Ti.UI.createLabel({\r\n\t\tfont:{\r\n\t\t\tfontWeight:'normal',\r\n\t\t\tfontSize:13\r\n\t\t},\r\n\t\tleft:5,\r\n\t\ttop: 35,\r\n\t\ttext:'Subtitle for Row '+num\t\t\r\n\t}));\r\n\treturn row;\r\n}\r\nfor(var i=0;i<6;i++) {\r\n\ttable.appendRow(makeRow(i));\r\n}\r\ntable.addEventListener('click', function(e){\r\n\te.row.children[1].text = 'You clicked row '+ e.index;\t\r\n});\r\n\r\nwin1.add(table);\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: children[] 'undefined' for table rows within event handler", "creator": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "environment": "Ti SDK: tested with 1.8.0.1 and 1.8.1.v20120123161633\r\nV8\r\nAndroid 2.2.3 (Droid original), Android 4.0.2 (Galaxy Nexus)\r\nOS X 10.7.2", "comment": { "comments": [ { "id": "181863", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The sample test code doesn't work. Also e.row.children is READ-ONLY (refer to docs). Test Code: \r\n{code}\r\nvar win1 = Ti.UI.createWindow({fullscreen:false});\r\nvar table = Ti.UI.createTableView();\r\nfunction makeRow(num) {\r\n\tvar row = Ti.UI.createTableViewRow({\r\n\t\theight:60,\r\n\t\trowID: num\r\n\t});\r\n\trow.add(Ti.UI.createLabel({\r\n\t\tfont:{\r\n\t\t\tfontWeight:'bold',\r\n\t\t\tfontSize:16\r\n\t\t},\r\n\t\tleft:5,\r\n\t\ttop: 0,\r\n\t\ttext:'Row '+num\r\n\t}));\r\n\trow.add(Ti.UI.createLabel({\r\n\t\tfont:{\r\n\t\t\tfontWeight:'normal',\r\n\t\t\tfontSize:13\r\n\t\t},\r\n\t\tleft:5,\r\n\t\ttop: 35,\r\n\t\ttext:'Subtitle for Row '+num\t\t\r\n\t}));\r\n\treturn row;\r\n}\r\nfor(var i=0;i<6;i++) {\r\n\ttable.appendRow(makeRow(i));\r\n}\r\ntable.addEventListener('click', function(e){\r\n Ti.API.info (\"row: \" + e.row);\r\n Ti.API.info (e.row.children[1].text);\r\n\t//e.row.children[1].text = 'You clicked row '+ e.index;\t\r\n});\r\n\r\nwin1.add(table);\r\nwin1.open();\r\n{code}\r\n\r\nTest Instructions: \r\n1. Run app\r\n2. Click on a row and you should see \"Subtitle for row ...\"", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-05T23:24:17.000+0000", "updated": "2012-02-05T23:26:13.000+0000" }, { "id": "181943", "author": { "name": "nderzhak", "key": "nderzhak", "displayName": "Nikolai Derzhak", "active": true, "timeZone": "America/Phoenix" }, "body": "This issue latest notification was not sent due to JIRA mail setting. Fixed now. Please check the issue for latests changes.", "updateAuthor": { "name": "nderzhak", "key": "nderzhak", "displayName": "Nikolai Derzhak", "active": true, "timeZone": "America/Phoenix" }, "created": "2012-02-06T06:35:22.000+0000", "updated": "2012-02-06T06:35:22.000+0000" }, { "id": "182727", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "e.row.children (the array) has always been read only. But the properties of the children have always been read/write. Are you closing this without action? Are properties of children now unwriteable? That is a change that will cause problems.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2012-02-10T05:34:52.000+0000", "updated": "2012-02-10T05:34:52.000+0000" }, { "id": "182728", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I totally agree with Tim.\r\n\r\n\r\nAs a workaround, custom property can be added to the row:\r\n\r\n\r\n{code}\r\nvar label = Ti.UI.createLabel();\r\nrow.add(label);\r\nrow.Label = label;\r\n\r\n//in event listener\r\ne.row.Label.text = 'Test';\r\n{code}", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-02-10T05:44:04.000+0000", "updated": "2012-02-10T05:44:04.000+0000" }, { "id": "182803", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Opening this issue based on Tim's comments. We need to address these concerns.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-10T15:06:33.000+0000", "updated": "2012-02-10T15:06:33.000+0000" }, { "id": "182808", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You can change the children properties. For example, e.row.children[0].backgroundColor = ...; The scope of this bug is to properly expose children[], not to change existing behaviors. ", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-10T15:32:29.000+0000", "updated": "2012-02-10T15:32:29.000+0000" }, { "id": "182814", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "The scope of this ticket was that with 1.8.1 you cannot change the properties of children. The code I submitted certainly does work and demonstrate that. However, I can confirm that the code as I supplied does work on the 1.9 branch. Thus I'm fine with closing this ticket now.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2012-02-10T16:14:40.000+0000", "updated": "2012-02-10T16:14:40.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }