{ "id": "169722", "key": "TIMOB-25247", "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": "19906", "description": "", "name": "Release 6.3.0", "archived": false, "released": true, "releaseDate": "2017-11-01" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-09-20T15:26:12.000+0000", "created": "2017-09-07T14:17:15.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "19870", "description": "", "name": "Release 6.1.2", "archived": false, "released": true, "releaseDate": "2017-08-03" }, { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" }, { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "issuelinks": [ { "id": "55896", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "158174", "key": "TIMOB-22224", "fields": { "summary": "Ti.UI.Picker Test Suite: Titanium.UI.Picker Acceptance TIMOB-10146", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } }, { "id": "55976", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "169800", "key": "TIMOB-25297", "fields": { "summary": "Windows: Ti.UI.Picker properties not working", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-10-09T15:10:33.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nCalling setSelectedRow causes no change in the UI\r\n\r\n{code}\r\nvar _window = Ti.UI.createWindow();\r\nvar picker = Ti.UI.createPicker({\r\n type: Ti.UI.PICKER_TYPE_PLAIN,\r\n selectionIndicator: true\r\n});\r\nvar data = [];\r\nvar answerLoop = 0;\r\n// add answers\r\nfor (answerLoop = 0; answerLoop < 11; answerLoop++) {\r\n data.push(Ti.UI.createPickerRow({\r\n title: 'Answer ' + answerLoop,\r\n custom_item: answerLoop\r\n }));\r\n}\r\npicker.add(data);\r\npicker.setSelectedRow(0, 5, true);\r\nconsole.log(picker.selectedRow);\r\nvar selectedButton = Ti.UI.createButton({\r\n title: 'Select Answer 6',\r\n width: 300,\r\n height: 'auto',\r\n top: 50\r\n});\r\nselectedButton.addEventListener('click', function(e) {\r\n picker.setSelectedRow(0, 6, true);\r\n console.log(picker.selectedRow);\r\n});\r\n_window.add(picker);\r\n_window.add(selectedButton);\r\n_window.open()\r\n\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n1. Add the above code to an existing app.js\r\n2. Build for Windows\r\n3. Click 'Select Answer 6'\r\n\r\nh5.Actual\r\n\r\nOn startup Answer 5 should be shown, after clicking the button home Answer 6 should be shown\r\n\r\nh5.Expected\r\n\r\nPicker remains blank", "attachment": [], "flagged": false, "summary": "Windows: Picker.setSelectedRow doesn't work", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Ti SDK 6.1.2.GA,6.2.0.v20170906064110, 7.0.0.v20170906135653", "closedSprints": [ { "id": 948, "state": "closed", "name": "2017 Sprint 19 SDK", "startDate": "2017-09-10T21:24:51.562Z", "endDate": "2017-09-24T21:24:00.000Z", "completeDate": "2017-09-25T17:49:27.460Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "427923", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I think the ticket description is not right. According to the API doc there's no {{selectedRow}} property defined in the Picker API. (See also http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.PickerRow). I would rename this to \"Picker.setSelectedRow doesn't work\".\r\n\r\nFor the issue around {{Picker.setSelectedRow}} which actually didn't work, I pushed a PR: https://github.com/appcelerator/titanium_mobile_windows/pull/1111\r\n\r\nTest Case:\r\n\r\n{code:javascript}\r\nvar _window = Ti.UI.createWindow();\r\nvar picker = Ti.UI.createPicker({\r\n type: Ti.UI.PICKER_TYPE_PLAIN,\r\n selectionIndicator: true\r\n});\r\nvar data = [];\r\nvar answerLoop = 0;\r\n// add answers\r\nfor (answerLoop = 0; answerLoop < 11; answerLoop++) {\r\n data.push(Ti.UI.createPickerRow({\r\n title: 'Answer ' + answerLoop,\r\n custom_item: answerLoop\r\n }));\r\n}\r\npicker.add(data);\r\npicker.setSelectedRow(0, 5, true);\r\nvar selectedButton = Ti.UI.createButton({\r\n title: 'Select Answer 6',\r\n width: 300,\r\n height: 'auto',\r\n top: 50\r\n});\r\nselectedButton.addEventListener('click', function (e) {\r\n picker.setSelectedRow(0, 6, true);\r\n console.log(picker.getSelectedRow(0).title);\r\n});\r\n_window.add(picker);\r\n_window.add(selectedButton);\r\n_window.open();\r\n{code}", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-09-15T08:37:11.000+0000", "updated": "2017-09-15T08:38:13.000+0000" }, { "id": "427924", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~kiguchi] Yeah you're right, sorry about that. I'll update the ticket accordingly", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2017-09-15T08:43:10.000+0000", "updated": "2017-09-15T08:43:10.000+0000" }, { "id": "428590", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "6_3_X: https://github.com/appcelerator/titanium_mobile_windows/pull/1124", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-09-29T00:02:44.000+0000", "updated": "2017-09-29T00:02:44.000+0000" }, { "id": "428824", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified in 6.3.0.v20171006185117 and 7.0.0.v20171009065347", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2017-10-09T15:10:01.000+0000", "updated": "2017-10-09T15:10:01.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }