{ "id": "91573", "key": "TIMOB-9053", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-07T21:27:03.000+0000", "created": "2012-05-08T09:33:19.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "parity" ], "versions": [ { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-07T21:27:03.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "h2. Problem\r\n\r\nWhen the cancel button of an [Titanium.UI.AlertDialog|http://docs.appcelerator.com/titanium/2.0/index.html#!/api/Titanium.UI.AlertDialog-property-cancel] is clicked, the cancel property on Android returns `true` whereas iOS returns the [cancel](Titanium.UI.AlertDialog.cancel) property, which will typically not change regardless of the button clicked.\r\n\r\nAs the Android behavior reduces developer code marginally, suggest that iOS be brought in line with it.\r\n\r\nAs the AlertDialog code is so closely related to OptionDialog, OptionDialog should be checked for this issue also.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\n Ti.UI.setBackgroundColor('white');\r\n var 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\n win.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\n win.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "TiAPI: UI.AlertDialog - click event cancel property parity issue", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": "* Titanium 2.0.1 GA2\r\n* Android APIs 2.2\r\n* v8\r\n* iOS 5\r\n", "comment": { "comments": [ { "id": "421244", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to lack of activity and time passed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-07T21:27:03.000+0000", "updated": "2017-06-07T21:27:03.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }