{ "id": "122728", "key": "TIMOB-15760", "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": "15711", "description": "2013 Sprint 24", "name": "2013 Sprint 24", "archived": true, "released": true, "releaseDate": "2013-11-29" }, { "id": "15712", "description": "2013 Sprint 24 API", "name": "2013 Sprint 24 API", "archived": true, "released": true, "releaseDate": "2013-11-29" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-04-21T17:54:59.000+0000", "created": "2013-11-21T00:12:41.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-closed-3.3.0", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-05-02T23:03:38.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": "If a picker is created, added to a window, and the window is opened, rows cannot be added.\r\n\r\nCalling \"add\" after the fact does nothing.\r\n\r\nTo reproduce:\r\nRun this code in app.js and click the button. You'll see that the rows are not added to the picket.\r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor : 'blue'\r\n});\r\nwin.open();\r\n \r\nvar box = Ti.UI.createPicker({\r\n top : 0,\r\n selectionIndicator : true,\r\n});\r\n \r\nvar btn = Ti.UI.createButton({\r\n title : 'test',\r\n height : 50,\r\n width : 200,\r\n bottom : 80\r\n});\r\n \r\nwin.add(box);\r\nbtn.addEventListener('click', function(e) {\r\n box.add([{\r\n title : '123'\r\n }, {\r\n title : '12344'\r\n }]);\r\n});\r\nwin.add(btn);\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.UI.Picker cannot add rows after picker is added to the window", "creator": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Ti SDK 3.2.0.v20131120142443\r\niOS 7\r\niOS 6", "comment": { "comments": [ { "id": "280439", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/5001", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-21T00:20:44.000+0000", "updated": "2013-11-21T00:20:44.000+0000" }, { "id": "301390", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening this issue as just wanted to confirm the behavior on iOS and Android\r\n\r\nTest Environment:\r\nAppc-Studio:3.2.3.201404162038\r\nsdk:3.3.0.v20140417173316\r\nacs:1.0.14\r\nalloy:1.3.1\r\nnpm:1.3.2\r\ntitanium:3.2.3-beta\r\ntitanium-code-processor:1.1.1-beta1\r\nxCODE:5.1.1\r\nDevice:Nexus5(v4.4.2),Iphone5(v7.1),Samsung Note(v2.3.6)\r\n\r\nUsed the code mentioned in the bug and observed the below result:\r\n\r\nObservations on iOS:\r\nRun this code in app.js and click the button. \r\nCould see the rows getting added on picker.\r\n\r\nObservations on Android:\r\nRun this code in app.js and click the button. \r\nCould not see the rows getting added on picker.\r\n\r\n\r\nBut as per the documentations\r\nhttp://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Picker-method-add\r\n\r\nadd( data ) : void\r\nAdds rows or columns to the picker.\r\nParameters\r\n\t•\tdata : Titanium.UI.PickerRow[]/Titanium.UI.PickerRow/Titanium.UI.PickerColumn[]/Titanium.UI.PickerColumnA row, set of rows, a column of rows or a set of columns of rows. When this method is used to add a row or set of rows, a single-column picker is created.
\r\n\r\nI modified the code as mentioned below code.\r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor : 'blue'\r\n});\r\nwin.open();\r\n \r\nvar box = Ti.UI.createPicker({\r\n top : 0,\r\n selectionIndicator : true,\r\n});\r\n \r\nvar btn = Ti.UI.createButton({\r\n title : 'test',\r\n height : 50,\r\n width : 200,\r\n bottom : 80\r\n});\r\n \r\nwin.add(box);\r\nvar data = [];\r\ndata[0]=Ti.UI.createPickerRow({title:'Bananas'});\r\ndata[1]=Ti.UI.createPickerRow({title:'Strawberries'});\r\ndata[2]=Ti.UI.createPickerRow({title:'Mangos'});\r\ndata[3]=Ti.UI.createPickerRow({title:'Grapes'});\r\nbtn.addEventListener('click', function(e) {\r\n box.add(data);\r\n});\r\nwin.add(btn);\r\n{code}\r\n\r\nObservations on iOS and Android\r\nRun this code in app.js and click the button. \r\nCould see the rows getting added on picker.\r\n\r\nPlease confirm the code and as well as the behavior on both Android and iOS\r\n", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-18T09:14:31.000+0000", "updated": "2014-04-18T09:14:31.000+0000" }, { "id": "303376", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and verified the fix with:\r\nAppcelerator Studio, build: 3.3.0.201405011408\r\nTitanium SDK, build: 3.3.0.v20140501144915\r\nCLI 3.3.0 -dev\r\nDevice:\r\niPhone 5S iOS 7.0.6\r\nNote:\r\nI tested Nexus5 Android version 4.4, it does work", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-02T22:59:46.000+0000", "updated": "2014-05-02T23:03:01.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }