{
"id": "135993",
"key": "ALOY-1125",
"fields": {
"issuetype": {
"id": "1",
"description": "A problem which impairs or prevents the functions of the product.",
"name": "Bug",
"subtask": false
},
"project": {
"id": "11113",
"key": "ALOY",
"name": "Alloy",
"projectCategory": {
"id": "10400",
"description": "Tools for developing applications",
"name": "Tooling"
}
},
"fixVersions": [],
"resolution": {
"id": "6",
"description": "",
"name": "Hold"
},
"resolutiondate": "2014-09-26T14:53:16.000+0000",
"created": "2014-09-02T17:30:42.000+0000",
"priority": {
"name": "Medium",
"id": "3"
},
"labels": [
"button",
"click",
"tableview",
"tableviewsection"
],
"versions": [
{
"id": "15909",
"description": "Alloy 1.5.0",
"name": "Alloy 1.5.0",
"archived": false,
"released": true,
"releaseDate": "2014-09-29"
},
{
"id": "16389",
"name": "Alloy 1.4.1",
"archived": false,
"released": true,
"releaseDate": "2014-07-28"
}
],
"issuelinks": [],
"assignee": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"updated": "2014-09-26T14:53:16.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": "12329",
"name": "Runtime",
"description": "Generic bucket for uncategorized runtime issues"
}
],
"description": "Click event doesn't trigger correctly. After few (~3) clicks the event is not triggered at all. Button basically behave as it was without any event listener.\r\n\r\nPlease look at it ASAP.\r\n\r\nindex.js (only)\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar table = Ti.UI.createTableView();\r\n\r\nvar row = Ti.UI.createTableViewRow({\r\n\tselectionStyle: Ti.UI.iPhone.TableViewCellSelectionStyle.NONE\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle: \"Press!\",\r\n\twidth: 50, height: 50,\r\n\tbackgroundColor: \"red\",\r\n\tright: 25\r\n});\r\n\r\nvar section = Ti.UI.createTableViewSection({\r\n\trows: [row]\r\n});\r\n\r\nbutton.addEventListener(\"click\", function(e) {\r\n\tconsole.log(e);\r\n});\r\n\r\nrow.add(button);\r\ntable.setData([section]);\r\n\r\nwin.add(table);\r\nwin.open();\r\n{code}",
"attachment": [
{
"id": "51341",
"filename": "app.js.zip",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-17T17:44:30.000+0000",
"size": 431,
"mimeType": "application/zip"
},
{
"id": "51345",
"filename": "app.zip",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-17T18:12:55.000+0000",
"size": 6055915,
"mimeType": "application/zip"
}
],
"flagged": false,
"summary": "Alloy: Button - Click event doesn't trigger",
"creator": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"subtasks": [],
"reporter": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"environment": "Alloy 1.4, Ti 3.3.0, iOS Simulator",
"closedSprints": [
{
"id": 217,
"state": "closed",
"name": "2014 Sprint 19 Alloy",
"startDate": "2014-09-15T12:45:43.956Z",
"endDate": "2014-09-29T12:45:00.000Z",
"completeDate": "2014-09-29T13:30:39.342Z",
"originBoardId": 124
},
{
"id": 206,
"state": "closed",
"name": "2014 Sprint 18 Alloy",
"startDate": "2014-09-02T13:23:09.065Z",
"endDate": "2014-09-16T13:23:00.000Z",
"completeDate": "2014-09-15T12:25:31.379Z",
"originBoardId": 124
}
],
"comment": {
"comments": [
{
"id": "321482",
"author": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"body": "Hi,\r\n\r\nYour test case is more like a normal project code, not a Alloy project.\r\nWould you please try to write your code like this,\r\n{code:title=index.xml}\r\n\r\n\t\r\n\t\t\r\n \r\n\t\t\t \r\n\t\t\t\t \r\n\t\t\t \r\n \r\n\t\t\r\n\t\r\n\r\n{code}\r\nThen \r\n{code:title=index.js}\r\n$.button.addEventListener(\"click\", function(e) {\r\n console.log(e);\r\n});\r\n\r\n$.index.open();\r\n{code}\r\n\r\nRegards,\r\nShuo",
"updateAuthor": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"created": "2014-09-03T00:29:50.000+0000",
"updated": "2014-09-03T01:15:54.000+0000"
},
{
"id": "321483",
"author": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"body": "Hi, yes I know. The thing is that it doesn't work even if there are nearly no changes...",
"updateAuthor": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"created": "2014-09-03T00:32:32.000+0000",
"updated": "2014-09-03T00:32:43.000+0000"
},
{
"id": "321485",
"author": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"body": "I just test it in my studio, SDK 3.3.0, iOS 7 simulator. It works well as expected. Event will be triggered no matter how many time click.\r\nWould you please test my code in you end?\r\nN.B. If you click the event real too quick, it will takes few seconds to response. ",
"updateAuthor": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"created": "2014-09-03T00:40:27.000+0000",
"updated": "2014-09-03T00:40:27.000+0000"
},
{
"id": "321487",
"author": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"body": "I am just looking at your code. That's not really the same thing. The TableView doesn't contain a TableViewSection.\r\n\r\n// OK, I did test it including a TableViewSection and it is working however it is not working if you do this:\r\n\r\nindex.js\r\n{code:javascript}\r\nvar row = Ti.UI.createTableViewRow({\r\n selectionStyle: Ti.UI.iPhone.TableViewCellSelectionStyle.NONE\r\n});\r\n \r\nvar button = Ti.UI.createButton({\r\n title: \"Press!\",\r\n width: 50, height: 50,\r\n backgroundColor: \"red\",\r\n right: 25\r\n});\r\n \r\nvar section = Ti.UI.createTableViewSection({\r\n rows: [row]\r\n});\r\n \r\nbutton.addEventListener(\"click\", function(e) {\r\n console.log(e);\r\n});\r\n \r\nrow.add(button);\r\n\r\n$.table.setData([section]);\r\n$.index.open();\r\n{code}\r\n\r\n{code:javascript}\r\n\r\n \r\n \r\n \r\n\r\n{code}\r\n\r\n(Sometimes it works three times, then just one and sometimes the button doesn't react at all)",
"updateAuthor": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"created": "2014-09-03T00:42:58.000+0000",
"updated": "2014-09-03T00:52:58.000+0000"
},
{
"id": "321490",
"author": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"body": "Ye, If the code structure like yours. The event will stop working after few times click. Anyway, I will forward this problem to our engineer to take care. For now, you'd better write code like my example. \r\n\r\nThank you for your report. ",
"updateAuthor": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"created": "2014-09-03T01:07:42.000+0000",
"updated": "2014-09-03T01:07:42.000+0000"
},
{
"id": "321491",
"author": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"body": "If my data was static I would do this for sure... but I have to select data from the database, adjust them etc... I can't do it as you recommend.",
"updateAuthor": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"created": "2014-09-03T01:10:19.000+0000",
"updated": "2014-09-03T01:10:39.000+0000"
},
{
"id": "321492",
"author": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"body": "[~tlukasavage], The ticket is that if alloy project with button like my test case (first comment). It will work well. \r\nIf the alloy project with button defined in js file like description and 4th comment, it will not work properly (Sometimes it works three times, then just one and sometimes the button doesn't react at all)). ",
"updateAuthor": {
"name": "sliang",
"key": "sliang",
"displayName": "Shuo Liang",
"active": true,
"timeZone": "Asia/Harbin"
},
"created": "2014-09-03T01:16:05.000+0000",
"updated": "2014-09-03T01:16:05.000+0000"
},
{
"id": "321612",
"author": {
"name": "ingo",
"key": "ingo",
"displayName": "Ingo Muschenetz",
"active": true,
"timeZone": "America/Los_Angeles"
},
"body": "Tim, thoughts.",
"updateAuthor": {
"name": "ingo",
"key": "ingo",
"displayName": "Ingo Muschenetz",
"active": true,
"timeZone": "America/Los_Angeles"
},
"created": "2014-09-03T17:09:41.000+0000",
"updated": "2014-09-03T17:09:41.000+0000"
},
{
"id": "321628",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"body": "I can confirm the issue using the Alloy version provided by [~sko] though I don't know the cause yet. However, making the following change, the button continues to respond to clicks as long as I click it:\r\n\r\n{code}\r\n$.table.setData([row]); // instead of section\r\n{code}\r\n\r\nI'm quite sure the Classic version failed (after five clicks) for me the first time I ran it as well. However, after attaching Instruments to the Simulator, I am no longer able to get that version to exhibit the failure. I've tried resetting the simulator but I can't get the Classic version to fail again.",
"updateAuthor": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-03T17:50:50.000+0000",
"updated": "2014-09-03T17:50:50.000+0000"
},
{
"id": "321691",
"author": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"body": "I am playing with it a little bit and it seems that all events are kind of disabled even custom ones ,so something like this is not working too.\r\n\r\n{code:javascript}\r\ntable.addEventListener(\"click\", function(e) {\r\n if (e.source.apiName === \"Ti.UI.Button\") {\r\n e.source.fireEvent(\"something\");\r\n }\r\n});\r\n{code}",
"updateAuthor": {
"name": "sko",
"key": "sko",
"displayName": "Matej",
"active": true,
"timeZone": "America/Los_Angeles"
},
"created": "2014-09-03T23:45:23.000+0000",
"updated": "2014-09-06T19:36:21.000+0000"
},
{
"id": "323135",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"body": "Some additional testing results:\r\n\r\nA) In Appcelerator Studio, I used debug mode with breakpoint set on console.log() statement. The button's click event listener continued to fire (~two dozen times before I stopped)\r\n\r\nB) Modified click handler to the following, normal (not debug build), and the click handler continued to fire (dozen+ times tested)\r\n\r\n{code}\r\nbutton.addEventListener(\"click\", function(e) {\r\n\tbutton.backgroundColor = \"yellow\";\r\n\tsetTimeout(function() {\r\n\t\tbutton.backgroundColor = 'red';\r\n\t}, 500);\r\n console.log(e);\r\n});\r\n{code}\r\n\r\nC) Changed event handler to be the following, normal build, and handler kept working:\r\n\r\n{code}\r\n$.table.addEventListener(\"click\", function(e) {\r\n console.log(e);\r\n});\r\n{code}\r\n\r\nBut putting the event handler on the button as originally shown, with a non-debug build, and the handler fires 3-5 times then stops firing.\r\n\r\nEnvironment: Appc Studio 3.4.0-rc, SDK 3.4.0-rc, CLI 3.4.0-rc, Alloy 1.5.0-rc, Xcode 6 GM, iOS8 simulator",
"updateAuthor": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-11T19:24:59.000+0000",
"updated": "2014-09-11T19:26:11.000+0000"
},
{
"id": "324276",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"body": "Additional test result:\r\n\r\nBuild the Alloy test case as included in the earlier comment, but don't interact with the simulator for approximately a minute. Then, click the button. No events are logged to the console. Change to {{$.table.setData(\\[row\\]); // instead of section}} as commented before and repeat. Events will be fired as expected.\r\n\r\nThe Classic example listed in the original description fires events even if you don't interact with the simulator for the minute or so.",
"updateAuthor": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-17T17:20:55.000+0000",
"updated": "2014-09-17T17:20:55.000+0000"
},
{
"id": "324286",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"body": "Classic version attached",
"updateAuthor": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-17T17:44:30.000+0000",
"updated": "2014-09-17T17:44:30.000+0000"
},
{
"id": "324302",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"body": "Updated Alloy sample attached",
"updateAuthor": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-17T18:12:55.000+0000",
"updated": "2014-09-17T18:12:55.000+0000"
},
{
"id": "324305",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"body": "Please see the attached Alloy sample. There are a couple of commented out code sections showing alternate techniques that work correctly in my testing. Of them, I suggest you change to the following as it offers the least amount of code change:\r\n\r\n{code}\r\nvar section = Ti.UI.createTableViewSection();\r\nsection.add(row);\r\n{code}\r\n\r\nIt would seem the getter function is more robust than directly setting the rows property of the section, despite not being able to reproduce it easily in Classic code.",
"updateAuthor": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-17T18:17:56.000+0000",
"updated": "2014-09-17T18:17:56.000+0000"
},
{
"id": "325842",
"author": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"body": "Though it has been difficult to reproduce with a Classic app, it appears to be ultimately an SDK issue. Any attempts to debug (using Instruments or Studio's debugger) prevents the issue from being encountered.\r\n\r\nI've provided multiple workarounds for the issue. Putting the ticket on hold pending further information.",
"updateAuthor": {
"name": "skypanther",
"key": "skypanther",
"displayName": "Tim Poulsen",
"active": true,
"timeZone": "America/New_York"
},
"created": "2014-09-26T14:53:16.000+0000",
"updated": "2014-09-26T14:53:16.000+0000"
}
],
"maxResults": 16,
"total": 16,
"startAt": 0
}
}
}