{ "id": "167813", "key": "TIMOB-24813", "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-08-28T03:36:45.000+0000", "created": "2017-05-19T16:04:27.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:37: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": [], "description": "I am using a simple optionDialog:\r\n\r\n\r\n\r\nwhen running on iOS, I get the following error: \r\nmessage = \"undefined is not an object (evaluating 'e.source.options[e.source.selectedIndex].toString')\";\r\n\r\nHowever, this works perfectly fine on Android. \r\n\r\nIt looks like on Android, selectedIndex is available, but when running on iOS, same parameter is named differently, 'index'.\r\n\r\nattached are the screenshots from debugging for both android and ios. \r\n\r\nThis should be uniform across both platforms.\r\n", "attachment": [ { "id": "62949", "filename": "observeView.js", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-07-31T13:17:32.000+0000", "size": 12399, "mimeType": "text/javascript" }, { "id": "62948", "filename": "observeView.tss", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-07-31T13:15:42.000+0000", "size": 1338, "mimeType": "application/octet-stream" }, { "id": "62256", "filename": "Screen Shot 2017-05-20 at 00.01.20.png", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-05-19T16:04:22.000+0000", "size": 461261, "mimeType": "image/png" }, { "id": "62255", "filename": "Screen Shot 2017-05-20 at 00.02.47.png", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-05-19T16:04:25.000+0000", "size": 640044, "mimeType": "image/png" } ], "flagged": false, "summary": "different sub-variable names for optionDialog ", "creator": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "subtasks": [], "reporter": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "environment": null, "closedSprints": [ { "id": 944, "state": "closed", "name": "2017 Sprint 18 SDK", "startDate": "2017-08-27T21:13:39.311Z", "endDate": "2017-09-10T21:13:00.000Z", "completeDate": "2017-09-10T21:24:16.435Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "425080", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~isener] Can you provide test code to reproduce this issue ? Thanks.\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-31T09:51:57.000+0000", "updated": "2017-07-31T09:51:57.000+0000" }, { "id": "425086", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "Sure. \r\n\r\nAttached and below should suffice I believe to reproduce the error.\r\n\r\nobserveView.js\r\n---------------\r\nfunction setOccupants(e) {\r\n // $.occp.title = (e.source.options[e.source.selectedIndex]).toString();\r\n\r\n var selectedItem;\r\n if (OS_IOS) {\r\n selectedItem = e.index;\r\n } else {\r\n selectedItem = e.source.selectedIndex;\r\n }\r\n\r\n $.occp.title = selectedItem.toString();\r\n\r\n if ((e.source.options[selectedItem]) > 1) {\r\n $.classView.show();\r\n $.classView.height = 30;\r\n $.classView.top = '5';\r\n } else {\r\n $.classView.height = 0;\r\n $.classView.hide();\r\n }\r\n}\r\n\r\n\r\n", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-07-31T13:18:27.000+0000", "updated": "2017-07-31T13:18:27.000+0000" }, { "id": "425171", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "\"index\" is available in both platforms as mentioned [here|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.OptionDialog-event-click]. It is property of event. \r\n\"selectedIndex\" is available with android only , as mentioned in doc [here|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.OptionDialog-property-selectedIndex]. It is property of option dialogue. So you can use in your code \r\n\r\nvar selectedItem = e.index ;\r\n\r\nrather \r\n\r\nvar selectedItem;\r\nif (OS_IOS)\r\n{ selectedItem = e.index; }\r\nelse\r\n{ selectedItem = e.source.selectedIndex; }", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-01T09:55:11.000+0000", "updated": "2017-08-01T09:55:11.000+0000" }, { "id": "427237", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~isener] \"index\" is available in both platform as mentioned in above comment. Can you verify at your end if its working. Thanks.\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-25T06:52:57.000+0000", "updated": "2017-08-25T06:52:57.000+0000" }, { "id": "427248", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "it should. Cheers.", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-08-25T11:44:59.000+0000", "updated": "2017-08-25T11:44:59.000+0000" }, { "id": "427298", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is not an issue. In previous comments, it is explained in detail. So resolving it.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-28T03:36:45.000+0000", "updated": "2017-08-28T03:36:45.000+0000" }, { "id": "439928", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid. If incorrect, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:37:03.000+0000", "updated": "2018-08-06T17:37:03.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }