{ "id": "117089", "key": "TIMOB-14526", "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": null, "resolutiondate": null, "created": "2013-07-11T11:59:37.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "qe-3.1.2" ], "versions": [ { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:13.000+0000", "status": { "description": "This issue is being actively worked on at the moment by the assignee.", "name": "In Progress", "id": "3", "statusCategory": { "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "addRow method of PickerColumn as per documentation must be passed with parameter as a row object.\r\nHence must give error if passed with unintended parameter.\r\niOS gives error but android is not giving any error.\r\n\r\nIts not a Regression since it occurs in 3.1.1GA\r\n\r\nSteps to reproduce:\r\n1. Copy the sample code given below in app.js of titanium mobile classic project.\r\n2. Click on button with title \"Add \"Manny\".\r\n\r\nActual Result:\r\n\r\nBoth ios and android behave differently.\r\nios gives error.\"invalid type passed to function at app.js(line 93)\"\r\nandroid does not gives error.\r\n\r\nExpected Result:\r\n\r\nBoth ios and android must give error.\"invalid type passed to function\"\r\n\r\n{code}\r\nvar w = Ti.UI.createWindow({\r\n backgroundColor : 'white'\r\n});\r\nvar status = Ti.UI.createLabel({\r\n bottom : '5dp',\r\n left : '5dp',\r\n right : '5dp',\r\n height : '40dp',\r\n textAlign : 'center',\r\n color:'black'\r\n});\r\nw.add(status);\r\n \r\nfunction showStatus(s) {\r\n status.text = s;\r\n}\r\n \r\nvar names = ['Joanie', 'Mickey', 'Jean-Pierre', 'Gustav', 'Raul', 'Mimi', 'Emily', 'Sandra', 'Carrie', 'Chachi'];\r\nvar verbs = ['loves', 'likes', 'visits', 'loathes', 'waves to', 'babysits', 'accompanies', 'teaches', 'announces', 'supports', 'knows', 'high-fives'];\r\n\r\n \r\nvar rows1 = [];\r\nfor (var i = 0; i < names.length; i++) {\r\n rows1.push(Ti.UI.createPickerRow({\r\n title : names[i]\r\n }));\r\n}\r\n \r\nvar rows2 = [];\r\nfor ( i = 0; i < verbs.length; i++) {\r\n rows2.push(Ti.UI.createPickerRow({\r\n title : verbs[i]\r\n }));\r\n}\r\n \r\nvar rows3 = [];\r\nfor ( i = (names.length - 1); i >= 0; i--) {\r\n rows3.push(Ti.UI.createPickerRow({\r\n title : names[i]\r\n }));\r\n}\r\n \r\nvar column1 = Ti.UI.createPickerColumn({\r\n rows : rows1,\r\n font : {\r\n fontSize : \"12\"\r\n }\r\n});\r\nvar column2 = Ti.UI.createPickerColumn({\r\n rows : rows2,\r\n font : {\r\n fontSize : \"12\"\r\n }\r\n});\r\nvar column3 = Ti.UI.createPickerColumn({\r\n rows : rows3,\r\n font : {\r\n fontSize : \"12\"\r\n }\r\n});\r\n \r\nvar picker = Ti.UI.createPicker({\r\n useSpinner : true,\r\n visibleItems : 7,\r\n type : Ti.UI.PICKER_TYPE_PLAIN,\r\n top : '150dp',\r\n height : '250dp',\r\n selectionIndicator: true,\r\n columns : [column1, column2, column3]\r\n});\r\n \r\npicker.addEventListener('change', function(e) {\r\n showStatus(e.selectedValue[0] + \" \" + e.selectedValue[1] + \" \" + e.selectedValue[2]);\r\n});\r\n \r\nw.add(picker);\r\n \r\nvar btnAdd = Ti.UI.createButton({\r\n left : '5dp',\r\n height : '40dp',\r\n top : '50dp',\r\n title : 'Add \"Manny\"'\r\n});\r\n\r\nbtnAdd.addEventListener('click', function() {\r\n picker.columns[0].addRow(Ti.UI.createPickerRow({\r\n title : 'Test Manny'\r\n }));\r\n picker.columns[2].addRow(Ti.UI.createPickerRow({\r\n title : 'Test Manny'\r\n }));\r\n // It must give error on both ios and android\r\n picker.columns[1].addRow(\"something\");\r\n \r\n if (Ti.Platform.osname != 'android') {\r\n\r\n picker.reloadColumn(picker.columns[0]);\r\n picker.reloadColumn(picker.columns[1]);\r\n picker.reloadColumn(picker.columns[2]);\r\n }\r\n \r\n});\r\nw.add(btnAdd);\r\nw.open(); \r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Picker Column- addRow method accepts unintended parameters", "creator": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio:3.1.2.201307091843\r\nTitanium SDK: 3.1.2.v20130710144553\r\nacs:1.0.3\r\nalloy:1.1.3\r\nnpm:1.2.14\r\ntitanium:3.1.1\r\ntitanium-code-processor:1.0.1\r\nOS: OSX 10.8\r\nDevice:iPhone 4(v 5.1), Galaxy Nexus (v 4.0.4)\r\nXcode: 4.5.1", "comment": { "comments": [ { "id": "264927", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "The input type is changed from Object to PickerRowProxy for addRow and removeRow\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4539", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-08-05T15:04:20.000+0000", "updated": "2013-08-05T15:04:20.000+0000" }, { "id": "270128", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is part of a bigger issue involving type checking. We'd need to discuss the parity on this.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-06T23:13:16.000+0000", "updated": "2013-09-06T23:13:16.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }