{ "id": "114608", "key": "TIMOB-13914", "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": "15564", "description": "2013 Sprint 15 API", "name": "2013 Sprint 15 API", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "id": "15567", "description": "2013 Sprint 15", "name": "2013 Sprint 15", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "id": "16586", "description": "Release 3.4.2", "name": "Release 3.4.2", "archived": false, "released": true, "releaseDate": "2017-03-11" }, { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-11-25T07:56:48.000+0000", "created": "2013-05-20T12:44:09.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "listview", "qe-closed-3.1.2", "qe-testadded" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "30101", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "113751", "key": "TIMOB-13752", "fields": { "summary": "Android: ListView missing events", "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": "Medium", "id": "3" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } }, { "id": "30414", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "117657", "key": "TIMOB-14679", "fields": { "summary": "Android: ListView event parity issues", "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": "31169", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "118651", "key": "TIMOB-14901", "fields": { "summary": "ListView: A button within a ListView does not trigger an 'itemclick' event when clicked", "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": "31168", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "118689", "key": "TIMOB-14902", "fields": { "summary": "Android: ListView itemclick event broken in 3.1.2.GA", "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 } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-11-25T07:56:48.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": "'longpress' event is not working in listView. Here is the test case:\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\n\r\nvar plainTemplate = {\r\n childTemplates: [\r\n {\r\n type: 'Ti.UI.Label', // Use a label\r\n bindId: 'rowtitle', // Bind ID for this label\r\n properties: { // Sets the Label.left property\r\n left: '10dp'\r\n }\r\n },\r\n {\r\n type: 'Ti.UI.ImageView', // Use an image view\r\n bindId: 'pic', // Bind ID for this image view\r\n properties: { // Sets the ImageView.image property\r\n \timage: 'KS_nav_ui.png'\r\n }\r\n }, \r\n {\r\n type: 'Ti.UI.Button', // Use a button\r\n bindId: 'button', // Bind ID for this button\r\n properties: { // Sets several button properties\r\n width: '80dp',\r\n height: '30dp', \t\r\n right: '10dp',\r\n title: 'press me'\r\n }\r\n \r\n }\r\n ]\r\n};\r\n\r\nfunction report(e) {\r\n\tTi.API.info(e.type);\r\n}\r\n\r\nvar listView = Ti.UI.createListView({\r\n // Maps the plainTemplate object to the 'plain' style name\r\n templates: { 'plain': plainTemplate },\r\n // Use the plain template, that is, the plainTemplate object defined earlier\r\n // for all data list items in this list view\r\n defaultItemTemplate: 'plain' \r\n});\r\n\r\nvar data = [];\r\nfor (var i = 0; i < 3; i++) {\r\n data.push({\r\n // Maps to the rowtitle component in the template\r\n // Sets the text property of the Label component\r\n rowtitle : { text: 'Row ' + (i + 1) },\r\n // Sets the regular list data properties\r\n properties : {\r\n itemId: 'row' + (i + 1),\r\n accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE\r\n }\r\n });\r\n}\r\n\r\nlistView.addEventListener('longpress', function(e){\r\n alert(\"longpress fired!!!\");\r\n});\r\nwin.add(listView);\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: 'longpress' event is not working in ListView", "creator": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.1.0", "closedSprints": [ { "id": 50, "state": "closed", "name": "2014 Sprint 09 Tooling", "startDate": "2014-04-28T15:43:24.381Z", "endDate": "2014-05-10T03:44:00.000Z", "completeDate": "2014-05-12T13:36:16.254Z", "originBoardId": 113 }, { "id": 219, "state": "closed", "name": "2014 Sprint 19 SDK", "startDate": "2014-09-18T21:06:27.559Z", "endDate": "2014-09-27T00:00:00.000Z", "completeDate": "2014-09-29T13:58:58.022Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "263286", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Additional test case: \n{code}\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\n \nvar plainTemplate = {\n childTemplates: [\n {\n type: 'Ti.UI.Label', // Use a label\n bindId: 'rowtitle', // Bind ID for this label\n properties: { // Sets the Label.left property\n left: '10dp',\n backgroundColor: 'blue'\n }\n },\n {\n type: 'Ti.UI.ImageView', // Use an image view\n bindId: 'pic', // Bind ID for this image view\n properties: { // Sets the ImageView.image property\n image: 'KS_nav_ui.png'\n }\n }, \n {\n type: 'Ti.UI.Button', // Use a button\n bindId: 'button', // Bind ID for this button\n properties: { // Sets several button properties\n width: '80dp',\n height: '30dp', \n right: '10dp',\n title: 'press me'\n }\n \n }\n ],\n events: {\n\t longpress: function(e) {\n\t Ti.API.log(\"Long press\");\n\t }\n\t }\n};\n \nfunction report(e) {\n Ti.API.info(e.type);\n}\n \nvar listView = Ti.UI.createListView({\n // Maps the plainTemplate object to the 'plain' style name\n templates: { 'plain': plainTemplate },\n // Use the plain template, that is, the plainTemplate object defined earlier\n // for all data list items in this list view\n defaultItemTemplate: 'plain' \n});\n \nvar data = [];\nfor (var i = 0; i < 3; i++) {\n data.push({\n // Maps to the rowtitle component in the template\n // Sets the text property of the Label component\n rowtitle : { text: 'Row ' + (i + 1) },\n // Sets the regular list data properties\n properties : {\n itemId: 'row' + (i + 1),\n accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE\n }\n });\n}\nvar section = Ti.UI.createListSection();\nsection.setItems(data);\nlistView.appendSection(section);\nwin.add(listView);\nwin.open();\n{code}\n\nTesting steps:\n1. Run above code\n2. Long press the list item, you should see \"Long press\" in log.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-25T23:40:21.000+0000", "updated": "2013-07-25T23:40:21.000+0000" }, { "id": "263305", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/4497", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T01:12:01.000+0000", "updated": "2013-07-26T01:12:01.000+0000" }, { "id": "263451", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "An extended test case:\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\n \r\nfunction isValidVar(check){\r\n if (check !== undefined && check !== null){\r\n return true;\r\n }\r\n return false;\r\n}\r\n \r\nfunction clickHandler(e){\r\n var message = 'Section title:'+e.section.headerTitle+'\\nsectionIndex:'+e.sectionIndex+'\\nitemIndex:'+e.itemIndex;\r\n if(isValidVar(e.bindId)){\r\n message += '\\nbindId:'+e.bindId;\r\n }\r\n if(isValidVar(e.itemId)){\r\n message += '\\nitemId:'+e.itemId;\r\n }\r\n Ti.API.info(message);\r\n}\r\n \r\n// Create a custom template that displays an image on the left,\r\n// then a title next to it with a subtitle below it.\r\nvar myTemplate = {\r\n childTemplates: [\r\n { // Image justified left\r\n type: 'Ti.UI.ImageView', // Use an image view for the image\r\n bindId: 'pic', // Maps to a custom pic property of the item data\r\n events:{\r\n longpress:clickHandler\r\n },\r\n properties: { // Sets the image view properties\r\n width: '50dp', height: '50dp', left: 0\r\n }\r\n },\r\n { // Title\r\n type: 'Ti.UI.Label', // Use a label for the title\r\n bindId: 'info', // Maps to a custom info property of the item data\r\n properties: { // Sets the label properties\r\n color: 'black',\r\n font: { fontFamily:'Arial', fontSize: '20dp', fontWeight:'bold' },\r\n left: '60dp', top: 0,\r\n }\r\n },\r\n { // Subtitle\r\n type: 'Ti.UI.Label', // Use a label for the subtitle\r\n bindId: 'es_info', // Maps to a custom es_info property of the item data\r\n properties: { // Sets the label properties\r\n color: 'gray',\r\n font: { fontFamily:'Arial', fontSize: '14dp' },\r\n left: '60dp', top: '25dp',\r\n }\r\n }\r\n ]\r\n};\r\n \r\nvar listView = Ti.UI.createListView({\r\n // Maps myTemplate dictionary to 'template' string\r\n templates: { 'template': myTemplate },\r\n // Use 'template', that is, the myTemplate dict created earlier\r\n // for all items as long as the template property is not defined for an item.\r\n defaultItemTemplate: 'template'\r\n});\r\nvar sections = [];\r\n \r\nvar fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits / Frutas'});\r\nvar fruitDataSet = [\r\n // the text property of info maps to the text property of the title label\r\n // the text property of es_info maps to text property of the subtitle label\r\n // the image property of pic maps to the image property of the image view\r\n { info: {text: 'Apple'}, es_info: {text: 'Manzana'}, pic: {image: 'face_happy.png'}},\r\n { info: {text: 'Banana'}, es_info: {text: 'Banana'}, pic: {image: 'KS_nav_ui.png'}}\r\n];\r\nfruitSection.setItems(fruitDataSet);\r\nsections.push(fruitSection);\r\n \r\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables / Verduras'});\r\nvar vegDataSet = [\r\n { info: {text: 'Carrot'}, es_info: {text: 'Zanahoria'}, pic: {image: 'KS_nav_views.png'}},\r\n { info: {text: 'Potato'}, es_info: {text: 'Patata'}, pic: {image: 'face_happy.png'}}\r\n];\r\nvegSection.setItems(vegDataSet);\r\nsections.push(vegSection);\r\n \r\nvar grainSection = Ti.UI.createListSection({ headerTitle: 'Grains / Granos'});\r\nvar grainDataSet = [\r\n { info: {text: 'Corn'}, es_info: {text: 'Maiz'}, pic: {image: 'KS_nav_ui.png'}},\r\n { info: {text: 'Rice'}, es_info: {text: 'Arroz'}, pic: {image: 'KS_nav_views.png'}}\r\n];\r\ngrainSection.setItems(grainDataSet);\r\nsections.push(grainSection);\r\n \r\nlistView.setSections(sections);\r\nwin.add(listView);\r\n \r\nlistView.addEventListener('longpress', function(e){\r\n Ti.API.info('LISTVIEW LONGPRESS '+JSON.stringify(e));\r\n})\r\nwin.open();\r\n{code}\r\n*Note:* When longpressing the label or the right white space of each item, it will log \"LISTVIEW LONGPRESS\" on iOS; but it does not log on Android. This parity issue is filed in TIMOB-14679.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T18:20:33.000+0000", "updated": "2013-07-26T21:22:43.000+0000" }, { "id": "263493", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T20:42:31.000+0000", "updated": "2013-07-26T20:42:31.000+0000" }, { "id": "263502", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "backport PR: https://github.com/appcelerator/titanium_mobile/pull/4504", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T21:13:12.000+0000", "updated": "2013-07-26T21:13:12.000+0000" }, { "id": "265236", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested above \"Additional test case\" and verified correct behavior with:\nAppcelerator Studio, build: 3.1.2.201308021524\nTitanium SDK, build: 3.1.2.v20130806104555\nAlloy 1.2.0-alpha6\nCLI: 3.1.2-alpha\nDevices:\nNexus7(2) Android version 4.3\nGalaxyS3 Android version 4.0.4\n\nConfirmed \"Long press\" in log.", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-06T23:05:08.000+0000", "updated": "2013-08-06T23:05:08.000+0000" }, { "id": "266962", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2013-08-16T21:58:34.000+0000", "updated": "2013-08-16T21:58:34.000+0000" }, { "id": "266968", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Titanium SDk, buld: 3.1.2.GA\nActual result:\n{code}\n08-16 15:10:52.710: I/TiAPI(5209): LISTVIEW LONGPRESS {\"type\":\"longpress\",\"source\":\n{code}", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-16T22:14:07.000+0000", "updated": "2013-08-16T22:14:07.000+0000" }, { "id": "293725", "author": { "name": "seph", "key": "seph", "displayName": "Yoseph", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The longpress event still not triggered on Android using SDK 3.2.1 GA. The event is triggered normally in iOS. The longclick event in Android is also not triggered.", "updateAuthor": { "name": "seph", "key": "seph", "displayName": "Yoseph", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-19T09:01:42.000+0000", "updated": "2014-02-19T09:01:42.000+0000" }, { "id": "293865", "author": { "name": "nepiddd", "key": "nepiddd", "displayName": "Dipen Bhikadya", "active": true, "timeZone": "America/New_York" }, "body": "This event doesn't trigger while running in Android 4.2.2. Development done with Alloy on SDK 3.2.1 GA. \r\n\r\nTo be specific event doesn't trigger when a row within the ListView is clicked. When clicked on a non-row area in the view it does get triggered.\r\n\r\nAlloy XML:\r\n{code} \r\n\t\r\n\t\t\r\n\t\t\t\t\r\n{code} \r\n\r\n\r\nController item binding:\r\n{code} \r\n\tvar myListData = [];\r\n\tif(otherData && otherData.length > 0){\r\n\t\totherData.forEach(function(item){\r\n\t\t\tmyListData.push({\r\n\t\t\t\tproperties: {\r\n\t\t\t\t\ttitle: item.otherName\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\t\r\n\t$.lsMyList.items = myListData;\r\n{code} \r\n\r\nThis bug should be reopened.", "updateAuthor": { "name": "nepiddd", "key": "nepiddd", "displayName": "Dipen Bhikadya", "active": true, "timeZone": "America/New_York" }, "created": "2014-02-20T01:46:57.000+0000", "updated": "2014-02-20T01:46:57.000+0000" }, { "id": "293867", "author": { "name": "nepiddd", "key": "nepiddd", "displayName": "Dipen Bhikadya", "active": true, "timeZone": "America/New_York" }, "body": "More details on this issue. Event remembers previous click on individual item. For example if item at index 1 was clicked before longpress on non-item area it fires event with itemIndex 1. If non-item area is longpressed without clicking any item first it fires event with itemIndex 0.", "updateAuthor": { "name": "nepiddd", "key": "nepiddd", "displayName": "Dipen Bhikadya", "active": true, "timeZone": "America/New_York" }, "created": "2014-02-20T02:25:10.000+0000", "updated": "2014-02-20T02:25:10.000+0000" }, { "id": "293951", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopened according to comments.\nConfirmed with \nAppcelerator Studio, build: 3.2.1.201402061120\nNode.JS Version: v0.10.13\nNPM Version: 1.3.2\n├── acs@1.0.12\n├── alloy@1.3.1\n├── npm@1.3.2\n├── titanium@3.2.1\n└── titanium-code-processor@1.1.0", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-20T17:43:35.000+0000", "updated": "2014-02-20T17:43:35.000+0000" }, { "id": "294102", "author": { "name": "nepiddd", "key": "nepiddd", "displayName": "Dipen Bhikadya", "active": true, "timeZone": "America/New_York" }, "body": "Anyone looking for a workaround should use a custom item template and place longpress event on the view within the custom template. Event fires correctly with the above steps. ", "updateAuthor": { "name": "nepiddd", "key": "nepiddd", "displayName": "Dipen Bhikadya", "active": true, "timeZone": "America/New_York" }, "created": "2014-02-21T12:00:09.000+0000", "updated": "2014-02-21T12:00:09.000+0000" }, { "id": "296306", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "body": "Replicated same error with Nexus 5, SDK 3.2.1 and following code:\n\n{code}\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\n \nvar listView = Ti.UI.createListView();\nvar sections = [];\n \nvar section = Ti.UI.createListSection();\nvar data = [\n { properties: { title: 'Row 1'} },\n { properties: { title: 'Row 2'} }\n];\nsection.setItems(data);\nsections.push(section);\n \nlistView.setSections(sections);\nwin.add(listView);\n\nlistView.addEventListener('longpress', function(e){\n Ti.API.info('LISTVIEW LONGPRESS '+JSON.stringify(e));\n});\nwin.open();\n{code}\n\nWorks fine if I longpress outside the rows, but doesn't fire if I longpress one of them.", "updateAuthor": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-03-10T15:40:47.000+0000", "updated": "2014-03-10T15:40:47.000+0000" }, { "id": "333582", "author": { "name": "vchidambaram", "key": "vchidambaram", "displayName": "Visalakshi Chidambaram", "active": true, "timeZone": "Asia/Shanghai" }, "body": "Working as expected with: \r\n\r\nAppc-Studio: 3.4.1.201410281743\r\nTitanium SDK: 3.5.0.v20141124155715 \r\nTitanium CLI: 3.4.1 GA\r\nAlloy : 1.5.1 GA\r\nOS: Mac OSX 10.9.4\r\nXcode: 6.1\r\nDevice: Samsung Galaxy Tab 3 (4.4.2)", "updateAuthor": { "name": "vchidambaram", "key": "vchidambaram", "displayName": "Visalakshi Chidambaram", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2014-11-25T07:54:42.000+0000", "updated": "2014-11-25T07:56:29.000+0000" } ], "maxResults": 18, "total": 18, "startAt": 0 } } }