{ "id": "173403", "key": "AC-6183", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2019-04-22T22:27:40.000+0000", "created": "2019-03-28T13:55:10.000+0000", "labels": [ "alert", "alertDialog", "ios", "itemclick", "listView" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-04-22T22:27:40.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "*Problem:*\r\nI have problem with big delay when I click templated (moderately complex\r\n) item of list view.\r\n\r\n{code:java}\r\nlistView.addEventListener(\"itemclick\", function(e){ù\r\n\r\n Ti.API.info(\"alert\");\r\n alert(\"Hello!\");\r\n // or\r\n // alertDialog();\r\n}) ;\r\n{code}\r\n\r\nWhen I click item I instantly see \"alert\" log in console but the alert \"Hello\" is shown width 1-2 seconds dalay. With SDK 8.0.0 the problem gets worse.\r\n\r\n*Workaround:*\r\nUsing event click configuration inside item template delay disappears.\r\n\r\n{code:java}\r\nvar itemTemplate = {\r\n properties: {\r\n accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE\r\n },\r\n events: {\r\n click: myEvent\r\n },\r\n}\r\n\r\nfunction myEvent(){\r\n Ti.API.info(\"alert\");\r\n alert(\"Hello!\");\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Delay showing alert in item click event", "creator": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "environment": "SDK >= 7.5.0\r\nSDK == 8.0.0 the worst", "comment": { "comments": [ { "id": "447363", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nTested the issue on android and iOS device both with the SDK 8.0.0.GA. Item click event is firing as expected.\r\n\r\n*Test Code:*\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\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 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 \ttype: 'Ti.UI.Button',\r\n \tbindId: 'button',\r\n \tproperties: {\r\n \t\ttitle: 'Click',\r\n \t\tbackgroundColor: 'blue',\r\n \t\tbackgroundSelectedColor: 'red',\r\n \t\tleft: '200dp',\r\n \t\taccessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE,\r\n \t\twidth: '60dp',\r\n \t\theight: '50dp'\r\n \t}\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: 'apple.png'}},\r\n { info: {text: 'Banana'}, es_info: {text: 'Banana'}, pic: {image: 'banana.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: 'carrot.png'}},\r\n { info: {text: 'Potato'}, es_info: {text: 'Patata'}, pic: {image: 'potato.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: 'corn.png'}},\r\n { info: {text: 'Rice'}, es_info: {text: 'Arroz'}, pic: {image: 'rice.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('itemclick', function(evt) {\r\n\tTi.API.info('Click on: ' + evt.sectionIndex + '/' + evt.itemIndex);\r\n});\r\n \r\nwin.open();\r\n{code}\r\n\r\n*Test Result:*\r\n{code}\r\n[INFO] : Click on: 1/1\r\n[INFO] : Click on: 2/0\r\n[INFO] : Click on: 2/0\r\n[INFO] : Click on: 1/1\r\n[INFO] : Click on: 1/0\r\n{code}\r\n\r\nCan you please test this sample code on your end and let us know how it goes.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-03-29T07:23:04.000+0000", "updated": "2019-04-09T18:20:11.000+0000" }, { "id": "447818", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nWe haven't heard back from you since our last response. I am just following up to check the status of this case and if you need further help on it. \r\n", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-04-21T11:56:56.000+0000", "updated": "2019-04-21T11:56:56.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }