{ "id": "84496", "key": "TIMOB-7008", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13408", "description": "Sprint 2012-12 API", "name": "Sprint 2012-12 API", "archived": true, "released": true, "releaseDate": "2012-06-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-04T03:49:20.000+0000", "created": "2012-01-05T13:44:03.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_tableviewrow", "qe-testadded" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "21921", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "103141", "key": "TIMOB-11389", "fields": { "summary": "Android: TableViewRow - Longpress on tableViewRow gives a RunTime Error", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "14445", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "84500", "key": "TIDOC-164", "fields": { "summary": "APIDoc: UI.TableView and TableViewRow- document supported events per platform", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2012-10-11T18:15:51.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.Problem\r\nAdding the eventListener of longpress to a TableViewRow does not fire the event.\r\n\r\nh2.Test Case\r\nMake a project with the below app.js. Long press on the row and notice that the event never fires.\r\n{code:title=app.js}\r\nvar win1 = Titanium.UI.createWindow({backgroundColor:'#000000'});\r\n\r\nvar row = Titanium.UI.createTableViewRow({height:'auto'});\r\nvar view = Titanium.UI.createView({backgroundColor:'red',width:'90%',height:'100%'});\r\nrow.add(view);\r\nrow.addEventListener('longpress', TableViewRowLongPress);\r\n\r\nvar table = Titanium.UI.createTableView();\r\ntable.appendRow(row);\r\nwin1.add(table);\r\n\r\nfunction TableViewRowLongPress(evt)\r\n{\r\n Ti.API.info('****TableViewRow longpress');\r\n}\r\n\r\nwin1.open();\r\n{code} \r\n\r\nh2.More Information\r\nThe above Test Case is not normally how we add data to a TableView. When assigning the data property of the TableView to an array you do not have access to the TableViewRow to attach a longpress listener. What would really be nice is to have the longpress event handled by the TableView itself and have the same information passed in the evt parameter as the click event (ie. row, rowData). ", "attachment": [], "flagged": false, "summary": "Android: tableViewRow - longpress event does not fire on TableViewRow", "creator": { "name": "jlbarnhart", "key": "jlbarnhart", "displayName": "Jon Barnhart", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jlbarnhart", "key": "jlbarnhart", "displayName": "Jon Barnhart", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium SDK 1.8.0.1\r\n* Android 2.2 \r\n* JS Runtime V8\r\n* emulator\r\n* Windows 7", "comment": { "comments": [ { "id": "179760", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Yes, please add longpress to TableView for Android and iOS (if you want to add/fix it to TableViewRow also, go ahead...but having it on TableView is more useful).", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-01-18T13:10:14.000+0000", "updated": "2012-01-18T13:15:17.000+0000" }, { "id": "180683", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Shawn\r\n\r\nIf you require this event for TableView, then please raise a ticket.\r\n\r\nThank you", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-26T09:55:10.000+0000", "updated": "2012-01-26T09:55:10.000+0000" }, { "id": "182562", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Shouldn't event propagation automatically fire longpress on the row, section, and TableView itself? Appcelerator documentation says _\"Events automatically propagate to parent views\"_.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-02-09T09:49:40.000+0000", "updated": "2012-02-09T09:49:40.000+0000" }, { "id": "184760", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Hey Ping, will this event propagate up to the TableView when you're done fixing it?", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-01T05:44:51.000+0000", "updated": "2012-03-01T05:44:51.000+0000" }, { "id": "184948", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Another test case:\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow();\r\nvar blueView = Ti.UI.createView({\r\n name: \"blueView\",\r\n backgroundColor: 'blue',\r\n width: 500,\r\n height: 500\r\n});\r\nvar whiteView = Ti.UI.createView({\r\n name: \"whiteView\",\r\n backgroundColor: 'white',\r\n width: 350,\r\n height: 350\r\n});\r\nvar redView = Ti.UI.createView({\r\n name: \"redView\",\r\n backgroundColor: 'red',\r\n width: 200,\r\n height: 200\r\n});\r\nvar greenView = Ti.UI.createView({\r\n name: \"greenView\",\r\n backgroundColor: 'green',\r\n width: 100,\r\n height: 100\r\n});\r\n\r\nblueView.add(whiteView);\r\nwhiteView.add(redView);\r\nwin.add(blueView);\r\nwin.add(greenView);\r\n\r\nblueView.addEventListener('doubletap', function(e) {\r\n Ti.API.info('*************Blue View doubletap: e.source = ' + e.source.name);\r\n});\r\n\r\nblueView.addEventListener('dblclick', function(e) {\r\n Ti.API.info('*************Blue View dblclick: e.source = ' + e.source.name);\r\n});\r\n\r\nblueView.addEventListener('singletap', function(e) {\r\n Ti.API.info('*************Blue View singletap: e.source = ' + e.source.name);\r\n});\r\n\r\nblueView.addEventListener('longpress', function(e) {\r\n Ti.API.info('*************Blue View longpress: e.source = ' + e.source.name);\r\n});\r\n\r\nblueView.addEventListener('click', function(e) {\r\n Ti.API.info('*************Blue View click: e.source = ' + e.source.name);\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nTesting steps:\r\n1. Run the above code\r\n2. Click/singletap/doubletap/doubleclick/longpress the blue/white/red area. Should see some output in the log.\r\n3. Click/singletap/doubletap/doubleclick/longpress the green area. Should not see any output in the log.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-02T15:57:43.000+0000", "updated": "2012-03-02T15:57:43.000+0000" }, { "id": "184955", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hey Shawn, events will propagate to the TableView after my fix.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-02T16:26:19.000+0000", "updated": "2012-03-02T16:26:19.000+0000" }, { "id": "184994", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "That's good news, Ping!\r\n\r\nHere's a modification of the original testcase, specific to TableViews, to test that longpress propagates up from the TableViewRow to the TableView:\r\n{noformat}\r\nvar win1 = Titanium.UI.createWindow({backgroundColor:'#000000'});\r\n\r\nvar row1 = Titanium.UI.createTableViewRow({height:'auto'});\r\nvar view1 = Titanium.UI.createView({backgroundColor:'red',width:'90%',height:'100%'});\r\nrow1.add(view1);\r\n\r\nvar table1 = Titanium.UI.createTableView();\r\ntable1.appendRow(row1);\r\nwin1.add(table1);\r\ntable1.addEventListener('longpress', TableViewLongPress);\r\n\r\nfunction TableViewLongPress(evt)\r\n{\r\n Ti.API.info('****TableView recognized longpress on row # '+evt.index);\r\n}\r\n\r\nwin1.open();\r\n{noformat}\r\n", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-05T05:52:00.000+0000", "updated": "2012-03-05T05:52:00.000+0000" }, { "id": "186199", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with Droid 2.2.2 with 2.0.0.v20120312213243", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-13T09:11:42.000+0000", "updated": "2012-03-13T09:11:42.000+0000" }, { "id": "187146", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "After testing, I've noticed that on Android, \"longclick\" is the event that will be noticed (instead of \"longpress\") at the TableView level, and the event's properties are: index, rowData, source, and type. This works for me.\r\n", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-19T12:37:55.000+0000", "updated": "2012-03-19T12:37:55.000+0000" }, { "id": "189611", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "I don't think we're quite there yet.\r\n\r\n\"longclick\" will fire at the TableView level, and its event carries index, rowData, source, and type properties.\r\n\r\n\"longpress\" will fire at the View level, but not the TableView level. It needs to propagate up to the TableView level and have row-specifying properties on its event. It needs index, rowData, source, and type properties.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-03T05:48:48.000+0000", "updated": "2012-04-03T10:40:02.000+0000" }, { "id": "191433", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "HD ticket: http://support.appcelerator.com/tickets/APP-843858 (for additional properties on the 'longpress' event).", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-17T13:58:30.000+0000", "updated": "2012-04-17T13:58:30.000+0000" }, { "id": "197199", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Additional data for the longpress event is a new feature and not in the scope of this bug.\r\n\r\nThere are already tickets (TIMOB-8795, TIMOB-8796) open for the new feature. Resolving this bug\r\n", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-06-04T21:46:00.000+0000", "updated": "2012-06-04T21:46:26.000+0000" }, { "id": "199921", "author": { "name": "psingh", "key": "psingh", "displayName": "Payminder Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Titanium Studio: 2.1.0.201206221045 & 2.0.2\r\nMobile SDK: 2.1.0.v20120622174154\r\nOS: X Lion\r\nDevice: Samsung Galaxy \r\n\r\nCan't reproduce.\r\n\r\n1. Based on updates test case (Ping Wang added a comment - 02/Mar/12 3:57 PM) unable to reproduce the bug. Longpress event does get fired. \r\n\r\n\r\n", "updateAuthor": { "name": "psingh", "key": "psingh", "displayName": "Payminder Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-23T13:54:09.000+0000", "updated": "2012-06-23T14:07:15.000+0000" }, { "id": "201485", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to edit label.", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-04T03:48:39.000+0000", "updated": "2012-07-04T03:48:39.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }