{ "id": "172768", "key": "TIMOB-26666", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2019-02-28T21:37:55.000+0000", "created": "2018-12-18T20:21:53.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [ { "id": "57076", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172103", "key": "TIMOB-26326", "fields": { "summary": "Android: TableView \"click\" event not firing after LiveView restarts app", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-02-28T21:37:55.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": "We have tested that click event is firing on tableView, but sometimes it does't fire on first or second or third click. \r\n\r\nCustomer also share a sample app with a video for demo checking. There, he escalated a scenario where this issue occurs more randomly. \r\n{code} \r\ncustomer scenario: \r\n# click on first item of first section\r\n# then click on 1st item of 2nd section any item of 3rd section\r\n# scroll back to another item sometime its work sometimes not\r\n{code}\r\nIt is not prominent, this issue will occur more randomly not regularly. \r\n*Video Link*: https://drive.google.com/uc?id=1EPs_qVuYKEFwXIGjlT4SJYIjz0EO1shI&export=download\r\n\r\nindex.tss\r\n{code}\r\n\"Window[platform=ios]\":{\r\n\tlayout:'vertical'\r\n},\r\n\"Window[platform=android]\":{\r\n},\r\n\r\n\"#headings[platform=android]\":{\r\n\ttop:5,\r\n},\r\n\"#headings[platform=ios]\":{\r\n\ttop:30,\r\n},\r\n\"Button\":{\r\n\ttop:5,bottom:5,\r\n\theight:Titanium.UI.SIZE,\r\n\tcolor:'#fff',\r\n\twidth: Titanium.UI.FILL,\r\n\tbackgroundColor: '#2b8ec7'\r\n},\r\n\"Button[platform=android]\":{\r\n\theight:35\r\n},\r\n\"Label\":{\r\n\ttop:10,bottom:5,left:10,\r\n\theight:Ti.UI.SIZE,\r\n\tcolor: '#0e0c0e',\r\n\twidth: Titanium.UI.FILL,\r\n\ttextAlign:\"left\",\r\n\tfont: {\r\n\t\tfontSize: 15,\r\n\t\tfontFamily: 'verdana,arial,sans-serif'\r\n\t}\r\n},\r\n\"#tableView\":{\r\n\ttop:0,\r\n\tbottom:50,\r\n\tleft:0,\r\n\tright:0,\r\n\tbackgroundColor:\"#fff\",\r\n\ttouchEnabled: true\r\n\t\r\n}\r\n{code}\r\n\r\nindex.js{code}var rowsData = [];\r\n\r\nfunction refreshList() {\r\n for (var i = 0; i <= 20; i++) {\r\n drawTableViewRow(i);\r\n }\r\n $.tableView.setData(rowsData);\r\n}\r\n\r\nrefreshList();\r\n\r\nfunction drawTableViewRow(i) {\r\n var row = Ti.UI.createTableViewRow({\r\n title : \"Row\" + i,\r\n className : 'rowTest',\r\n touchEnabled : true,\r\n height : 40,\r\n hasCheck : false\r\n });\r\n\r\n var rightView = Ti.UI.createView({\r\n layout : 'vertical',\r\n left : 90,\r\n right : 10,\r\n top : 5,\r\n height : Ti.UI.SIZE,\r\n width : Ti.UI.FILL\r\n });\r\n\r\n var caption = Titanium.UI.createLabel({\r\n width : Ti.UI.SIZE,\r\n ellipsize : true,\r\n wordWrap : false,\r\n top : \"5\",\r\n left : 0,\r\n text : '2018-12-12 - ' + i,\r\n font : {\r\n fontSize : '14',\r\n fontWeight : \"bold\"\r\n },\r\n color : '#000'\r\n });\r\n rightView.add(caption);\r\n row.add(rightView);\r\n if (i == 0 || i == 5 || i == 10) {\r\n var sectionView = Ti.UI.createView({\r\n layout : 'vertical',\r\n left : 90,\r\n right : 10,\r\n top : 5,\r\n height : 30,\r\n width : Ti.UI.FILL,\r\n backgroundColor : \"#eaeaea\"\r\n });\r\n\r\n var sectionLabel = Titanium.UI.createLabel({\r\n width : Ti.UI.SIZE,\r\n ellipsize : true,\r\n wordWrap : false,\r\n top : \"5\",\r\n text : 'section - ' + i,\r\n font : {\r\n fontSize : '14',\r\n fontWeight : \"bold\"\r\n },\r\n color : '#000'\r\n });\r\n sectionView.add(sectionLabel);\r\n var section = Ti.UI.createTableViewSection({\r\n headerView : sectionView\r\n });\r\n section.add(row);\r\n rowsData.push(section);\r\n } else {\r\n rowsData.push(row);\r\n }\r\n\r\n}\r\n\r\n//section.add(row);\r\n\r\n// THIS WILL KILL THE EVENT LISTENER\r\n//table.sections = [section];\r\n\r\n// THIS WILL KILL THE EVENT LISTENER\r\n//table.appendSection(section);\r\n\r\n// THIS WORKS\r\n//table.setData([section]);\r\n\r\n// table.addEventListener(\"click\", function(event) {\r\n// alert(\"TableView Clicked\");\r\n// Ti.API.debug(event.row);\r\n// });\r\n\r\nfunction markSelected(e) {\r\n\r\n console.log(' markSelected() ' + e.row.hasCheck);\r\n var row = e.row;\r\n row.hasCheck = !row.hasCheck;\r\n //console.log('JSON: ', e.rowData);\r\n // var someRowsSelected = false;\r\n // e.row.hasCheck = !e.row.hasCheck;\r\n // var rows = $.tableView.data[0].rows;\r\n // for (var i = 0; i < rows.length; i++) {\r\n // Ti.API.info(JSON.stringify(rows[i]));\r\n // Ti.API.info(\"rows[i].hasCheck:\" + rows[i].hasCheck);\r\n // if (rows[i].hasCheck) {\r\n // someRowsSelected = true;\r\n // break;\r\n // }\r\n // }\r\n // Ti.API.info(\"someRowsSelected:\" + someRowsSelected);\r\n // if (someRowsSelected) {\r\n // console.log('here 1');\r\n // //$.deleteSelectedButton.show();\r\n // } else {\r\n // console.log('here 2');\r\n // //$.deleteSelectedButton.hide();\r\n // }\r\n row = null;\r\n};\r\n\r\n$.win.open();\r\n{code}\r\n\r\nindex.xml\r\n{code} \r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: TableView won't fire click events properly.", "creator": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Microsoft Windows 8.1 Pro with Media Center\r\n Version = 6.3.9600\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 6298132480\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version = 7.5.0.GA\r\n SDK Path = C:\\ProgramData\\Titanium\\mobilesdk\\win32\\7.5.0.GA\r\n Target Platform = android\r\n android version = 8.1.0", "comment": { "comments": [ { "id": "444725", "author": { "name": "homeinspectorpro", "key": "homeinspectorpro", "displayName": "Dominic Maricic", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for posting this. This has been a major issue for our users since we updated. We believe it started after SDK 7.4 as we can't replicate the issue on the older SDK versions. Our users are on the app 8+ hours a day to perform home inspections and this is causing them to miss lots of issues as they think it's selected and it's not.", "updateAuthor": { "name": "homeinspectorpro", "key": "homeinspectorpro", "displayName": "Dominic Maricic", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-12-19T01:45:00.000+0000", "updated": "2018-12-19T01:45:00.000+0000" }, { "id": "445296", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~homeinspectorpro] Your test case is quite complex. I've simplified it to the basic components in order to better isolate the issue:\r\n{code:js}\r\nconst win = Ti.UI.createWindow({ backgroundColor: 'gray' });\r\nconst section = Ti.UI.createTableViewSection();\r\n\r\nfor (let i = 1; i <= 100; i++) {\r\n section.add(\r\n Ti.UI.createTableViewRow({\r\n title: 'Row ' + i,\r\n height: 40,\r\n hasCheck: false\r\n })\r\n );\r\n}\r\n\r\nconst tableView = Ti.UI.createTableView({ data: [ section ] });\r\n\r\ntableView.addEventListener('click', (e) => {\r\n const row = e.row;\r\n row.hasCheck = !row.hasCheck;\r\n});\r\n\r\nwin.add(tableView);\r\nwin.open();\r\n{code}\r\n\r\nAlthough, I'm having trouble reproducing the issue.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-01-14T23:50:31.000+0000", "updated": "2019-01-14T23:50:31.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }