{ "id": "98015", "key": "TIMOB-10146", "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": "13870", "description": "", "name": "Sprint 2012-16 API", "archived": true, "released": true, "releaseDate": "2012-08-13" }, { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-14T10:41:06.000+0000", "created": "2012-07-25T16:10:33.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "module_picker", "parity", "qe-testadded" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13270", "description": "Release 1.8 Service Pack 3 (CI for 1_8_X)", "name": "Release 1.8.3", "archived": true, "released": false } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2012-08-14T17:38:37.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": "By default 'Answer 5' should be selected on starting the app but it selects \"Answer 0\" on iOS. This code works fine on Android but not on iOS. \r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tlayout: 'vertical'\r\n});\r\n\r\nvar picker = Ti.UI.createPicker({\r\n\ttype: Ti.UI.PICKER_TYPE_PLAIN,\r\n\tselectionIndicator: true\r\n});\r\n\r\n\r\nvar data = [];\r\nvar answerLoop = 0;\r\n\r\n// add answers\r\nfor (answerLoop = 0; answerLoop < 11; answerLoop++) {\r\n\tdata.push(Ti.UI.createPickerRow({\r\n\t\ttitle: 'Answer ' + answerLoop,\r\n\t\tcustom_item: answerLoop\r\n\t}));\r\n}\r\n\r\npicker.add(data);\r\n\r\n// THIS IS WHERE THE BUG IS\r\n// This should selected the value 'Answer 5' but as you can see, Answer 1 is selected at startup\r\npicker.setSelectedRow(0, 5, true);\r\n\r\nvar selectedButton = Ti.UI.createButton({\r\n\ttitle: 'Select Answer 6',\r\n\twidth: 300,\r\n\theight: 'auto'\r\n});\r\nselectedButton.addEventListener('click', function(e) {\r\n\tpicker.setSelectedRow(0, 6, true);\r\n});\r\n\r\nwin.add(picker);\r\nwin.add(selectedButton);\r\n\r\nwin.open();\r\n\r\n{code}\r\n\r\n\r\nh4.STEPS TO REPRODUCE:\r\n1. Load the above code into app.js\r\n2. Run the project on iPhone simulator.", "attachment": [], "flagged": false, "summary": "iOS: setSelectedRow on picker not working if window not open", "creator": { "name": "aakkinepally", "key": "aakkinepally", "displayName": "Amuktha Akkinepally", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aakkinepally", "key": "aakkinepally", "displayName": "Amuktha Akkinepally", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio, build: 2.1.0.201206251749\r\niOS 5", "comment": { "comments": [ { "id": "210219", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "It is documented that this method should be called after the picker is rendered (in the example above in the open event handler of the window). However we will investigate if there is a way to fix it (we did this for map annotations).", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-07-27T10:29:33.000+0000", "updated": "2012-07-27T10:29:33.000+0000" }, { "id": "211316", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending https://github.com/appcelerator/titanium_mobile/pull/2671", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-08-02T16:05:47.000+0000", "updated": "2012-08-02T16:05:47.000+0000" }, { "id": "213511", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update labels", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-09T04:02:08.000+0000", "updated": "2012-08-09T04:02:08.000+0000" }, { "id": "214348", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update fixVersion label 2.1.2", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-14T10:40:31.000+0000", "updated": "2012-08-14T10:40:31.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }