{ "id": "175911", "key": "TIMOB-28291", "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": "21177", "name": "Release 9.3.1", "archived": false, "released": true, "releaseDate": "2021-01-26" } ], "resolution": null, "resolutiondate": null, "created": "2020-12-15T12:22:43.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "listview", "regression" ], "versions": [ { "id": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-01-19T19:53:52.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": "I've got a ListView with an ItemTemplate on which some Views have onSingletap and onDoubletap listeners\r\n\r\nMy alloy View:\r\n\r\n{code:xml}\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n{code}\r\n\r\nIn controller, gestureForwarder handler function simply logs the event payload \"stringified\" and attribute .type is undefined. I've fixed this rebuilding the SDK with a little modification. In ListItemProxy.java, in function generateViewFromTemplate, adding this line\r\n\r\n{code:java}\r\npayload.put(TiC.EVENT_PROPERTY_TYPE, eventName);\r\n{code}\r\n\r\nBesides this, I observe another 2 issues:\r\n1) If I add onClick event for a view in the template that also has the onSingletap o onDoubletap, both events are triggered (click+singletap or click+doubletap).\r\n2) The onLongpress event is also triggered without the .type property and, in this case, all the listview properties (sectionIndex, itemIndex, etc...) are not included either. (Same with swipe events)\r\n\r\nAll this events are working fine on SDK 9.2 and lower.", "attachment": [], "flagged": false, "summary": "View events in a ListView ItemTemplate doesn't include property type", "creator": { "name": "rfarfan", "key": "rfarfan", "displayName": "Rodrigo Farfán", "active": true, "timeZone": "Europe/Madrid" }, "subtasks": [], "reporter": { "name": "rfarfan", "key": "rfarfan", "displayName": "Rodrigo Farfán", "active": true, "timeZone": "Europe/Madrid" }, "environment": "Ti SDK 9.3.0 RC", "closedSprints": [ { "id": 1214, "state": "closed", "name": "2021 Sprint 1", "startDate": "2021-01-04T17:38:57.886Z", "endDate": "2021-01-15T17:38:00.000Z", "completeDate": "2021-01-15T20:35:11.006Z", "originBoardId": 114 }, { "id": 1215, "state": "closed", "name": "2021 Sprint 2", "startDate": "2021-01-18T20:36:00.000Z", "endDate": "2021-01-29T20:36:00.000Z", "completeDate": "2021-01-31T17:42:28.052Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "457901", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "I can repro this issue, classic code that repros the missing type property. However I'm seeing that click+singletap are fired on 9.2.2.GA also so might not be identical to the Alloy code\r\n\r\n{code}\r\nconst win = Ti.UI.createWindow();\r\nconst fruitSection = Ti.UI.createListSection({\r\n headerTitle: 'Fruits',\r\n items: [{ info: {text: 'Apple'}}, { info: {text: 'Banana'}}]\r\n});\r\nconst listView = Ti.UI.createListView({\r\n templates: { 'template': {\r\n childTemplates: [\r\n {\r\n type: 'Ti.UI.View',\r\n properties: {\r\n borderColor: 'red',\r\n borderRadius: 1,\r\n height: 50\r\n },\r\n events: {\r\n longpress: function(e) {\r\n console.log('view longpress');\r\n console.log(`type = ${e.type}`);\r\n console.log(e);\r\n },\r\n click: function(e) {\r\n console.log('view click');\r\n console.log(`type = ${e.type}`);\r\n console.log(e);\r\n }\r\n }\r\n },\r\n {\r\n type: 'Ti.UI.Label',\r\n bindId: 'info',\r\n 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 ]\r\n }},\r\n defaultItemTemplate: 'template',\r\n sections: [\r\n fruitSection\r\n ]\r\n});\r\nwin.add(listView);\r\nwin.open();\r\n\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-12-15T16:53:34.000+0000", "updated": "2020-12-15T16:53:34.000+0000" }, { "id": "457904", "author": { "name": "rfarfan", "key": "rfarfan", "displayName": "Rodrigo Farfán", "active": true, "timeZone": "Europe/Madrid" }, "body": "Hmmmm... maybe I'm confused about the click+singletap on 9.2 (must check it again). Regarding classic code and longpress event, did you notice what I said about the list related properties (sectionIndex, itemIndex,...)?", "updateAuthor": { "name": "rfarfan", "key": "rfarfan", "displayName": "Rodrigo Farfán", "active": true, "timeZone": "Europe/Madrid" }, "created": "2020-12-15T18:03:12.000+0000", "updated": "2020-12-15T18:03:12.000+0000" }, { "id": "457915", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "As we've also discussed on TiSlack, I would like to point out events bound on specific UI elements in ListViews might not behave as you can expect, and any \"working\" behaviour in the past is not something you should be trusting. If you need to bind eventListeners on UI elements it is recommended to use TableViews. \r\n\r\nExcerpt from the ListView documentation: {{List view is designed for performance. One side effect of the design is that you cannot directly manipulate the views--add children, set view properties and bind event callbacks--as you can in TableView. Instead, you interact with list items indirectly, using templates and data items.}}\r\n\r\nThe ListView does however appear to have issues with not all event properties propagating properly it seems (like bindId)\r\n", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-12-16T14:16:04.000+0000", "updated": "2020-12-16T14:16:04.000+0000" }, { "id": "457918", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/12348", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-12-17T04:07:31.000+0000", "updated": "2020-12-17T04:07:31.000+0000" }, { "id": "458032", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, waiting on Jenkins build.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-01-18T16:37:25.000+0000", "updated": "2021-01-18T16:37:25.000+0000" }, { "id": "458040", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master, backport for 9_3_X merged for 9.3.1 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-01-19T17:47:03.000+0000", "updated": "2021-01-19T19:53:38.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }