{ "id": "103869", "key": "TIMOB-11569", "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": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14700", "description": "2012 Sprint 25", "name": "2012 Sprint 25", "archived": true, "released": true, "releaseDate": "2012-12-17" }, { "id": "14784", "description": "2012 Sprint 25 API", "name": "2012 Sprint 25 API", "archived": true, "released": true, "releaseDate": "2012-12-17" } ], "resolution": null, "resolutiondate": null, "created": "2012-10-24T21:43:25.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam", "engSchedule", "module_picker", "qe-testadded" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" }, { "id": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "issuelinks": [ { "id": "24691", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "108105", "key": "TIMOB-12341", "fields": { "summary": "Backport TIMOB-11569 to 3.0.2", "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": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-02-24T10:14:43.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h1. Problem description\r\nAdding a picker to an alert dialog does not work on Android.\r\n\r\nh1. Steps to reproduce\r\n- Use this code to reproduce the bug:\r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n title : 'Bug Isolation',\r\n backgroundColor : 'white',\r\n barColor : '#0066CC',\r\n navBarHidden : false,\r\n tabBarHidden : true\r\n});\r\n\r\nvar alertView = Ti.UI.createView({\r\n top : '0dp'\r\n});\r\n\r\nvar monthPicker = Ti.UI.createPicker({\r\n top : '5dp',\r\n width : '150dp',\r\n left : '5dp'\r\n});\r\n\r\nvar months = [];\r\nmonths[0]=Ti.UI.createPickerRow({title:'January'});\r\nmonths[1]=Ti.UI.createPickerRow({title:'February'});\r\nmonths[2]=Ti.UI.createPickerRow({title:'March'});\r\nmonths[3]=Ti.UI.createPickerRow({title:'April'});\r\nmonths[4]=Ti.UI.createPickerRow({title:'May'});\r\nmonths[5]=Ti.UI.createPickerRow({title:'June'});\r\nmonths[6]=Ti.UI.createPickerRow({title:'July'});\r\nmonths[7]=Ti.UI.createPickerRow({title:'August'});\r\nmonths[8]=Ti.UI.createPickerRow({title:'September'});\r\nmonths[9]=Ti.UI.createPickerRow({title:'October'});\r\nmonths[10]=Ti.UI.createPickerRow({title:'November'});\r\nmonths[11]=Ti.UI.createPickerRow({title:'December'});\r\n\r\nmonthPicker.add(months);\r\nmonthPicker.selectionIndicator = true;\r\n\r\nvar yearPicker = Ti.UI.createPicker({\r\n top : '5dp',\r\n width : '100dp',\r\n right : '5dp'\r\n});\r\n\r\nvar years = [];\r\nvar yearRange = {min: new Date().getFullYear(), max: (new Date().getFullYear() + 10)}\r\nfor (var i = yearRange.min; i <= yearRange.max; i++){\r\n var item = Ti.UI.createPickerRow({title: i.toString()});\r\n years.push(item);\r\n}\r\n\r\nyearPicker.add(years);\r\nyearPicker.selectionIndicator = true;\r\n\r\nalertView.add(monthPicker);\r\nalertView.add(yearPicker);\r\n\r\nvar expDateAlert = Ti.UI.createAlertDialog({\r\n title : 'Exp. Date:',\r\n buttonNames : ['Set', 'Cancel'],\r\n cancel : 1,\r\n androidView : alertView\r\n});\r\n\r\nexpDateAlert.addEventListener('click', function(e){\r\n if (e.index == 0){\r\n Ti.API.info('monthPicker: ' + JSON.stringify(monthPicker.getSelectedRow(0).title));\r\n Ti.API.info('yearPicker: ' + JSON.stringify(yearPicker.getSelectedRow(0).title));\r\n }\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n title : 'click me',\r\n bottom : '5dp',\r\n height : '50dp',\r\n width : '200dp'\r\n});\r\n\r\nbutton.addEventListener('click', function(e){\r\n expDateAlert.show();\r\n});\r\n\r\nwin.add(button);\r\n\r\nwin.open();\r\n{code}\r\n\r\n- Run the app and click the button: a dialog appears\r\n- Try to use the picker views: they won't work\r\n", "attachment": [], "flagged": false, "summary": "Android: Picker does not work if put inside an AlertDialog", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android 2.1.3,2.3.3\r\nAndroid 4.1, Android 6.0", "comment": { "comments": [ { "id": "234957", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/3525", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-18T13:33:21.000+0000", "updated": "2013-01-18T13:33:21.000+0000" }, { "id": "234965", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport PR https://github.com/appcelerator/titanium_mobile/pull/3733\nBackport task TIMOB-12341", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-18T14:34:59.000+0000", "updated": "2013-01-18T14:34:59.000+0000" }, { "id": "235045", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Environment used for verification -\r\nTitanium SDK: 3.1.0.v20130114171802\r\nTitanium  Studio:3.0.1.201212181159\r\nDevice: Samsung GALAXY Note (2.3.6)", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-21T01:59:01.000+0000", "updated": "2013-01-21T01:59:01.000+0000" }, { "id": "235050", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also verified on tab nexus 7 android 4.1\nAnd Titanium SDK: 3.0.2.v20130118180632", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-21T02:26:01.000+0000", "updated": "2013-01-21T02:26:01.000+0000" }, { "id": "282590", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I am able to reproduce this issue.\r\nIt works fine on SDK:3.1.1.GA, issue exist on SDK: 3.1.3.GA, 3.1.2.GA\r\n\r\nSteps to reproduce:\r\n1. Run the above app.\r\n2. Click on click me button\r\n3. Click on the month picker\r\n4. Click on Set and Cancel button \r\n\r\nExpected:\r\nThe alert dialog closes and no error is shown.\r\nPicked month and year are printed on console.\r\n\r\nActual:\r\nRuntime Exception is occured as\"\r\n12-05 17:10:43.091: E/TiExceptionHandler(29802): (main) [25082,25082] ----- Titanium Javascript Runtime Error -----\r\n12-05 17:10:43.091: E/TiExceptionHandler(29802): (main) [0,25082] - In acceptance.js:640,70\r\n12-05 17:10:43.091: E/TiExceptionHandler(29802): (main) [1,25083] - Message: Uncaught TypeError: Cannot read property 'title' of null\r\n12-05 17:10:43.091: E/TiExceptionHandler(29802): (main) [0,25083] - Source: API.info('yearPicker: ' + JSON.stringify(yearPicker.getSelectedRow(0).title));\r\n12-05 17:10:43.111: E/V8Exception(29802): Exception occurred at acceptance.js:640: Uncaught TypeError: Cannot read property 'title' of null\"\r\n\r\n", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-12-05T11:54:39.000+0000", "updated": "2013-12-05T11:54:39.000+0000" }, { "id": "455207", "author": { "name": "srai", "key": "srai", "displayName": "Saumya Rai", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hpham] This issue still exists on android. ", "updateAuthor": { "name": "srai", "key": "srai", "displayName": "Saumya Rai", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-22T07:34:15.000+0000", "updated": "2021-02-24T10:14:43.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }