{ "id": "130569", "key": "TIMOB-16975", "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": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-05-22T17:26:46.000+0000", "created": "2014-05-16T20:55:20.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-10T20:41:10.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": "10230", "name": "BlackBerry", "description": "BlackBerry Platform" } ], "description": "From an AlertDialog, button clicks emit the same source and index in the event object. The index should be different for each button.\r\n\r\n{code}\r\nTi.UI.setBackgroundColor('white');\r\nvar win = Ti.UI.createWindow({\r\n title: 'Click window to test',\r\n backgroundColor: 'white',\r\n exitOnClose: true,\r\n fullscreen: false\r\n});\r\nwin.addEventListener('click', function(e){\r\n var dialog = Ti.UI.createAlertDialog({\r\n cancel: 1,\r\n buttonNames: ['Confirm', 'Cancel', 'Help'],\r\n message: 'Would you like to delete the file?',\r\n title: 'Delete'\r\n });\r\n dialog.addEventListener('click', function(e){\r\n if (e.index === e.source.cancel){\r\n Ti.API.info('The cancel button was clicked');\r\n }\r\n Ti.API.info('e.cancel: ' + e.cancel);\r\n Ti.API.info('e.source.cancel: ' + e.source.cancel);\r\n Ti.API.info('e.index: ' + e.index);\r\n });\r\n dialog.show();\r\n});\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "BlackBerry: AlertDialog button clicks always returning the same index and cancel value", "creator": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "306096", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR for Master: https://github.com/appcelerator/titanium_mobile_blackberry/pull/237\r\nPR for 3.3.X https://github.com/appcelerator/titanium_mobile_blackberry/pull/238", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-22T17:25:19.000+0000", "updated": "2014-05-22T17:25:19.000+0000" }, { "id": "308336", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and verified fixed with:\r\nMac osx 10.9.3 Mavericks\r\nAppcelerator Studio, build: 3.3.0.201406061445\r\nTitanium SDK, build: 3.3.0.v20140609184912 \r\nNode.JS Version: v0.10.13 \r\nNPM Version: 1.3.2 \r\nacs@1.0.14 \r\nalloy@1.4.0-beta \r\nnpm@1.3.2 \r\ntitanium@3.3.0-beta2 \r\ntitanium-code-processor@1.1.1\r\nDevice: BB Z10 (10.2.1)\r\n\r\nh5. Actual result\r\ndifferent index clicking different buttons(e.g. Confirm Cancel Help)\r\n{code}\r\n[INFO] The cancel button was clicked\r\n[INFO] e.cancel: 1\r\n[INFO] e.source.cancel: 1\r\n[INFO] e.index: 1\r\n[INFO] e.cancel: 0\r\n[INFO] e.source.cancel: 1\r\n[INFO] e.index: 0\r\n[INFO] The cancel button was clicked\r\n[INFO] e.cancel: 1\r\n[INFO] e.source.cancel: 1\r\n[INFO] e.index: 1\r\n[INFO] e.cancel: 0\r\n[INFO] e.source.cancel: 1\r\n[INFO] e.index: 2\r\n{code}", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-10T20:40:55.000+0000", "updated": "2014-06-10T20:40:55.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }