{ "id": "104667", "key": "TIMOB-11691", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14624", "description": "2012 Sprint 24 JS", "name": "2012 Sprint 24", "archived": true, "released": true, "releaseDate": "2012-12-03" }, { "id": "14625", "description": "2012 Sprint 24 API", "name": "2012 Sprint 24 API", "archived": true, "released": true, "releaseDate": "2012-12-03" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-11-21T22:45:13.000+0000", "created": "2012-11-07T22:35:54.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_tableviewrow", "qe-testadded", "regression" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-08-27T10:31:16.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When creating a custom row that includes a button as a child, and adding a click event listener to the table, the \"row\" property is not being added to the click event as it bubbles up.\r\n\r\nFor some reason it seems to be added for other view types, but not for buttons.\r\n\r\nTest case:\r\n\r\n{code}\r\nTi.UI.setBackgroundColor('#000');\r\n\r\nvar win = Ti.UI.createWindow({\r\n\ttitle : 'TableView Event Bubbling',\r\n});\r\n\r\nfunction makeRow() {\r\n\tvar row= Ti.UI.createTableViewRow({\r\n\t\tbackgroundColor: 'white',\r\n\t\tclassName: 'myRowClass'\r\n\t});\r\n\trow.add(Ti.UI.createButton({\r\n\t\ttitle: \"My Button\",\r\n\t\tleft: 0,\r\n\t\ttop: 50\r\n\t}));\r\n\trow.add(Ti.UI.createLabel({\r\n\t\ttext: Math.random().toString(36).substring(7),\r\n\t\tleft: 10,\r\n\t\tright: 10,\r\n\t\ttextAlign: Ti.UI.TEXT_ALIGN_CENTER,\r\n\t\ttop: 0,\r\n\t\ttouchEnabled: true\r\n\t}))\r\n\trow.add(Ti.UI.createImageView({\r\n\t\timage: 'KS_nav_ui.png',\r\n\t\tright: 0,\r\n\t\ttop: 50,\r\n\t\ttouchEnabled: true\r\n\t}));\r\n\treturn row;\r\n}\r\nvar data = [];\r\nfor(var i = 0; i < 100; i++) {\r\n\tdata.push(makeRow());\r\n}\r\n\r\nvar tbl = Ti.UI.createTableView({\r\n\tdata: data\r\n});\r\ntbl.addEventListener('click', function(e) {\r\n\tTi.API.info(\"e.row =\" + e.row + \", e.source = \" + e.source);\r\n});\r\nwin.add(tbl);\r\nwin.open();\r\n{code}\r\n\r\nOn 2.1.3, if I click around, I get:\r\n\r\n{code}\r\n[INFO] TableViewRows/1.0 (2.1.3.GA.15997d0)\r\n[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUIButton]\r\n[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUITableViewRow]\r\n[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUIImageView]\r\n[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUILabel]\r\n{code}\r\n\r\nBut on 2.1.4, I get: \r\n\r\n{code}\r\n[INFO] TableViewRows/1.0 (3.1.0.v20121106112514.971021f)\r\n[ERROR] TableViewRow structures for className myRowClass does not match\r\n[ERROR] TableViewRow structures for className myRowClass does not match\r\n[ERROR] TableViewRow structures for className myRowClass does not match\r\n[ERROR] TableViewRow structures for className myRowClass does not match\r\n[INFO] e.row =undefined, e.source = [object TiUIButton]\r\n[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUITableViewRow]\r\n[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUIImageView]\r\n[INFO] e.row =[object TiUITableViewRow], e.source = [object TiUILabel]\r\n{code}\r\n\r\nSo 3.0/3.1 logs an error \"structures for className does not match\", and the button click doesn't have a row property.", "attachment": [], "flagged": false, "summary": "iOS: Click event on button in TableViewRow doesn't include row property", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "228247", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending https://github.com/appcelerator/titanium_mobile/pull/3455", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-11-21T18:01:46.000+0000", "updated": "2012-11-21T18:01:46.000+0000" }, { "id": "228282", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport PR https://github.com/appcelerator/titanium_mobile/pull/3461", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-11-21T20:36:32.000+0000", "updated": "2012-11-21T20:36:32.000+0000" }, { "id": "234895", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with: \r\nSDK:3.1.0.v20130114171802\r\nStudio:3.0.1.201212181159\r\nDevice: iPhone3GS(v5.0.1)", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-18T02:59:47.000+0000", "updated": "2013-01-18T02:59:47.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }