{ "id": "112577", "key": "TIMOB-13499", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15401", "description": "2013 Sprint 08 Core", "name": "2013 Sprint 08 Core", "archived": true, "released": true, "releaseDate": "2013-04-22" }, { "id": "15106", "description": "2013 Sprint 08", "name": "2013 Sprint 08", "archived": true, "released": true, "releaseDate": "2013-04-22" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-04-09T19:42:37.000+0000", "created": "2013-04-09T04:01:32.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios", "listview", "listviewitem", "qe-closed-3.1.0", "qe-testadded", "release-note", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-12-01T02:39:14.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": "*Problem*\r\nWhen selecting a row and navigating to the next screen then tapping back to the window with the listview the selected row is still selected. Apple will reject apps with this behavior. \r\n\r\n*Expected Behavior*\r\nThe listview should be deselected when returning to the window.\r\n\r\n*Requested Feature*\r\nThis control also needs to a method to support deselectItem \r\n\r\n*Steps to Reproduce*\r\n1. Copy and paste code provided below into app.js\r\n2. Run on 3.1.xx or higher on iOS\r\n3. Click \"Open ListView Tests\" button\r\n4. Click \"Basic\" ListViewRow\r\n5. Click on any row\r\n6. Click back nav button\r\n7. Notice \"Basic\" is still selected\r\n\r\n\r\n{code}\r\nvar rootWin;\r\nvar isAndroid = Ti.Platform.osname == 'android';\r\n\r\nfunction createAndroidNavGroup() {\r\n\treturn {\r\n\t\topen : function(openWin, props) {\r\n\t\t\topenWin.fullscreen = true;\r\n\t\t\topenWin.backgroundColor = 'blue';\r\n\t\t\topenWin.open();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvar navGroup = isAndroid ? createAndroidNavGroup() : Ti.UI.iPhone.createNavigationGroup({\r\n\twindow : rootWin = Ti.UI.createWindow()\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n title: 'Open ListView Tests'\r\n});\r\nbutton.addEventListener('click', function() {\r\n\topenTestsWindow();\r\n});\r\nvar label = Ti.UI.createLabel({\r\n\ttext: \"Return to this screen to check for memory leaks.\\nEnsure garbage collection by doing 'Simulate Memory Warning'\",\r\n\tleft: 5,\r\n\tcolor: 'red',\r\n\tbottom: 20\r\n});\r\nif (isAndroid) {\r\n\tvar navWin = Ti.UI.createWindow({ backgroundColor: 'white' });\r\n\r\n\tnavWin.add(button);\r\n\tnavWin.add(label);\r\n} else {\r\n\trootWin.add(button);\r\n\trootWin.add(label);\r\n\r\n\tvar navWin = Ti.UI.createWindow();\r\n\tnavWin.add(navGroup);\r\n}\r\nnavWin.open();\r\n\r\n\r\nfunction openTestsWindow() {\r\n\tvar win = Ti.UI.createWindow({\r\n\t\ttitle : 'ListView Tests'\r\n\t});\r\n\tvar listView = Ti.UI.createListView();\r\n\r\n\tvar section = Ti.UI.createListSection({\r\n\t\theaderTitle : 'Items'\r\n\t});\r\n\tsection.setItems([{\r\n\t\tproperties : {\r\n\t\t\ttitle : 'Basic',\r\n\t\t\titemId : 'basic',\r\n\t\t\taccessoryType : Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE\r\n\t\t}\r\n\t}]);\r\n\tlistView.appendSection(section);\r\n\r\n\tlistView.addEventListener('itemclick', function(e) {\r\n\t\tvar f = tests[e.itemId];\r\n\t\tif (f)\r\n\t\t\tf();\r\n\t});\r\n\twin.add(listView);\r\n\tnavGroup.open(win, {\r\n\t\tanimated : true\r\n\t});\r\n}\r\n\r\nvar tests = {};\r\n\r\ntests.basic = function() {\r\n\tvar win = Ti.UI.createWindow({\r\n\t\ttitle : 'Basic'\r\n\t});\r\n\tvar section = Ti.UI.createListSection();\r\n\tvar items = [];\r\n\tfor (var i = 0; i < 1000; ++i) {\r\n\t\titems.push({\r\n\t\t\tproperties : {\r\n\t\t\t\ttitle : 'Item ' + i\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\tsection.setItems(items);\r\n\tvar listView = Ti.UI.createListView({\r\n\t\tsections : [section]\r\n\t});\r\n\twin.add(listView);\r\n\tnavGroup.open(win, {\r\n\t\tanimated : true\r\n\t});\r\n}\r\n{code}", "attachment": [ { "id": "37272", "filename": "app.js", "author": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "created": "2013-04-09T17:50:26.000+0000", "size": 1944, "mimeType": "text/javascript" }, { "id": "37274", "filename": "listview.tiff", "author": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "created": "2013-04-09T17:52:31.000+0000", "size": 317744, "mimeType": "image/tiff" } ], "flagged": false, "summary": "iOS: ListView row still selected when returning to the window", "creator": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "3.1.0.v20130408134547\r\nKitchen Sink", "comment": { "comments": [ { "id": "246657", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Darren, \nIn order for a bug to be reviewed, we need to see a test case that explicitly shows the issue. By this I mean a simple piece of code that can be copy and pasted into an app.js that shows the problem. Please refer to: \nhttps://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report\non how to write an acceptable bug report.\nThanks,\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T17:31:19.000+0000", "updated": "2013-04-09T17:31:19.000+0000" }, { "id": "246663", "author": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "body": "I have added a simple test case and screenshot showing the row still selected after navigating back to the list view.", "updateAuthor": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "created": "2013-04-09T17:50:26.000+0000", "updated": "2013-04-09T17:50:26.000+0000" }, { "id": "246676", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Darren, confirmed bug. I have moved along to engineering. Please keep a watch on this for the fix. Thank you for bringing this to our attention.\nRegards,\nCarter\n", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T18:08:50.000+0000", "updated": "2013-04-09T18:08:50.000+0000" }, { "id": "246702", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/4132\n3_1_X PR https://github.com/appcelerator/titanium_mobile/pull/4133", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T19:18:59.000+0000", "updated": "2013-04-09T19:18:59.000+0000" }, { "id": "246716", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Merged", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T19:42:37.000+0000", "updated": "2013-04-09T19:42:37.000+0000" }, { "id": "246769", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed in simulator and on device:\nMac OS 10.8.3\nXcode 4.6\nCLI: 3.1.0-cr\nAlloy: 1.1.0-cr\nAppcelerator Studio, build: 3.1.0.201304082106\nTitanium SDK version 3.1.0.v20130409124549\niPhone 5 6.0 ", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T23:05:34.000+0000", "updated": "2013-04-09T23:05:34.000+0000" }, { "id": "246825", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The selection of the cell item seems to be ok. Unfortunately, the cell stays selected until the opened window is closed (in contrast to the older API, where the selection was blured when opening the window). \r\n\r\nCombined with this problem, after closing a window, the color of the rows stays default and not reacts to the highlightedColor property, although it is set. \r\n\r\nShould i wrap it up in a single entry?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-10T06:55:38.000+0000", "updated": "2013-04-10T06:55:38.000+0000" }, { "id": "247172", "author": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "body": "I am getting an error trying the deselect function. My app has a custom navigation using views appears to not call the will show function. Was this function not exposed??\r\n\r\n[ERROR] : \b\b \b message = \"'undefined' is not a function (evaluating 'listView.deselectAll(false)')\";\r\n[ERROR] : \b\b \b name = TypeError;\r\n[ERROR] : \b\b \b sourceId = 233103680;", "updateAuthor": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "created": "2013-04-11T21:32:03.000+0000", "updated": "2013-04-11T21:32:03.000+0000" }, { "id": "247323", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "deselectAll is not exposed to the JS side. Private API", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-12T18:55:17.000+0000", "updated": "2013-04-12T18:55:17.000+0000" }, { "id": "247420", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Shouldn't the ListItems be deselected by default when receiving a click event? The native UITableView-API does that and the \"old\" Ti.UI.TableView as well.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-13T11:53:13.000+0000", "updated": "2013-04-13T11:53:13.000+0000" }, { "id": "248495", "author": { "name": "crossbits", "key": "crossbits", "displayName": "Danny Pham", "active": true, "timeZone": "Europe/Berlin" }, "body": "Agree with Hans. I open an optionDialog on click instead of a child window, in this case the row always stays selected.\r\n\r\nSo in TiUIListView.m I have added:\r\n\r\n{code}\r\n[tableView deselectRowAtIndexPath:indexPath animated:YES];\r\n{code}", "updateAuthor": { "name": "crossbits", "key": "crossbits", "displayName": "Danny Pham", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-20T01:12:21.000+0000", "updated": "2013-04-20T01:12:21.000+0000" }, { "id": "261234", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Any update on deselecting ListItems? Thanks.", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2013-07-10T09:08:53.000+0000", "updated": "2013-07-10T09:08:53.000+0000" }, { "id": "261243", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~mokesmokes] DeselectItem was implemented as part of TIMOB-13417", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-07-10T13:19:18.000+0000", "updated": "2013-07-10T13:19:18.000+0000" }, { "id": "269259", "author": { "name": "seguri", "key": "seguri", "displayName": "Marco Seguri", "active": true, "timeZone": "Europe/Berlin" }, "body": "I just copied and pasted the \"List View Sections\" example from [Titanium.UI.ListView|http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.ListView], the deselectItem bug is not fixed in 3.2.0.\r\n\r\n[http://i.imgur.com/csxk2uj.png]", "updateAuthor": { "name": "seguri", "key": "seguri", "displayName": "Marco Seguri", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-09-03T11:22:03.000+0000", "updated": "2013-09-03T11:22:03.000+0000" }, { "id": "269265", "author": { "name": "seguri", "key": "seguri", "displayName": "Marco Seguri", "active": true, "timeZone": "Europe/Berlin" }, "body": "And this is a screenshot of the sample in this ticket: [screenshot|http://i.imgur.com/HWXv9Pq.png]", "updateAuthor": { "name": "seguri", "key": "seguri", "displayName": "Marco Seguri", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-09-03T12:03:51.000+0000", "updated": "2013-09-03T12:03:51.000+0000" }, { "id": "274769", "author": { "name": "laddi", "key": "laddi", "displayName": "Þórhallur Helgason", "active": true, "timeZone": "Etc/GMT" }, "body": "I can confirm that this worked fine in 3.1.2GA but stopped working properly in 3.1.3GA. A fix would be greatly appreciated...", "updateAuthor": { "name": "laddi", "key": "laddi", "displayName": "Þórhallur Helgason", "active": true, "timeZone": "Etc/GMT" }, "created": "2013-10-11T09:12:41.000+0000", "updated": "2013-10-11T09:12:41.000+0000" }, { "id": "306398", "author": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi All,\r\nI am facing the similar issue. I have posted my question on forum.http://developer.appcelerator.com/question/174326/listview-background-color\r\nPlease look into that and help me to sort out this.\r\nThanks in advance.", "updateAuthor": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-05-26T06:54:46.000+0000", "updated": "2014-05-26T06:54:46.000+0000" }, { "id": "306581", "author": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi All, When i use ,\r\nmyList.addEventListener('itemclick', function(e){\r\n myList.deselectItem(e.sectionIndex, e.itemIndex);\r\n});\r\n\r\nIt's working fine on iOS. But Android giving the error of \"deselect is not a method\" .\r\nIs there any solutions.?", "updateAuthor": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-05-28T04:33:19.000+0000", "updated": "2014-05-28T04:33:19.000+0000" }, { "id": "306611", "author": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I have Coded for separate os by checking the Ti.Platform.osname. And for android deselectItem is no need. Because already its looks like deselecteditem. Thanks", "updateAuthor": { "name": "simbu", "key": "simbu", "displayName": "Silambarasan Raman", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-05-28T11:03:29.000+0000", "updated": "2014-05-28T11:03:29.000+0000" }, { "id": "334086", "author": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "body": "What's the latest on this fix? The stopgap solution is a bit slower than desired...", "updateAuthor": { "name": "Yrkh8trnoy", "key": "yrkh8trnoy", "displayName": "Kiley Williams", "active": true, "timeZone": "America/Vancouver" }, "created": "2014-12-01T02:39:14.000+0000", "updated": "2014-12-01T02:39:14.000+0000" } ], "maxResults": 20, "total": 20, "startAt": 0 } } }