{ "id": "63458", "key": "TIMOB-2826", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-26T22:12:13.000+0000", "created": "2011-04-15T03:30:32.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "documentation", "ios", "iphone", "optiondialog" ], "versions": [], "issuelinks": [ { "id": "19366", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "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": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-26T22:13:36.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Problem:

\n

According to the docs*, the cancel property of the\noptionDialog click event is a \"boolean to indicate if\nthe cancel button was pressed\", but it is the index of the button\nthat was originally passed to the\ncreateOptionDialog.

\n

Example:

\n
\n// index 4 is the cancel button\nvar opts = ['a', 'b', 'c', 'd', 'Cancel'];\n\nvar dialog = Ti.UI.createOptionDialog({\n    title: 'Test',\n    options: opts,\n    cancel: opts.length -1\n});\n\ndialog.addEventListener('click', function(e) {\n    Ti.API.info(e);\n})\n
\n

When clicking the 'Cancel' option with the above code, the\nresult is:

\n
\n[INFO] {\ncancel = 4;\ndestructive = \"-1\";\nindex = 4;\nsource = \"[object TiUIOptionDialog]\";\ntype = click;\n}\n
\n

Expected result:

\n
\n[INFO] {\ncancel = True;\ndestructive = \"-1\";\nindex = 4;\nsource = \"[object TiUIOptionDialog]\";\ntype = click;\n}\n
\n

So this is either a bug in the click event object construction\nor the documentation.

\n

I'm using 1.5.1.

\n

[*] \nhttp://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI....

{html}", "attachment": [], "flagged": false, "summary": "iOS optionDialog clickEvent.cancel should be boolean", "creator": { "name": "ernesto", "key": "ernesto", "displayName": "Ernesto", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ernesto", "key": "ernesto", "displayName": "Ernesto", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "209742", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated to be correct in latest available docs (http://docs.appcelerator.com)", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-26T13:43:53.000+0000", "updated": "2012-07-26T13:43:53.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }