{ "id": "62976", "key": "TIMOB-2344", "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": "11227", "name": "Release 1.5.0 M02", "archived": true, "released": true, "releaseDate": "2010-11-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:58:50.000+0000", "created": "2011-04-15T03:17:15.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "android_refactor", "defect", "regression" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:58:50.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
\nvar win = Ti.UI.createWindow({\n    top: 0, left: 0, right: 0, bottom: 0,\n    backgroundColor: 'black'\n});\n\nvar data = [];\nvar row = Ti.UI.createTableViewRow({title: \"Test Row\", hasChild: true});\ndata.push(row);\n\nvar tbl = Ti.UI.createTableView({\n    data: data,\n    top: 100, left: 0\n});\nwin.add(tbl);\n\nvar menu = Ti.UI.Android.OptionMenu.createMenu();\nvar editBtn = Ti.UI.createButton({\n    title: 'Edit',\n    top: 0, left: 0\n});\n\neditBtn.addEventListener('click', function() {      \n    for (var i in tbl.data) {\n        for (var j=0 ; j < tbl.data[i].rowCount ; j++) {\n            var row = tbl.data[i].rowAtIndex(j);\n            if (!row.cb) {\n                row.cb = Ti.UI.createSwitch({\n                    visible: !row.hasChild,\n                    style: Ti.UI.Android.SWITCH_STYLE_CHECKBOX,\n                    right: -5, // Negate the built-in pad\n                });\n                row.add(row.cb);\n            }\n            \n            row.hasChild   = !row.hasChild;\n            row.cb.visible = !row.cb.visible;\n        }\n    }\n    tbl.data = tbl.data;\n});\nwin.add(editBtn);\nwin.open();\n
\n

Click the menu button once, everything toggles as expected.\nClick it a second time, crash.

\n

W/KrollConverter( 3298): (kroll$3) [3470,11710] Unhandled type\nconversion: value: [object TiUITableViewSection] type:\nti.modules.titanium.ui.TableViewSectionProxy, invocation:\n[setProperty UI.TableView.data\nti.modules.titanium.ui.TableViewProxyBindingGen$2@48360280]
\nF/dalvikvm( 3298): Exception!!! threadid=1: thread exiting with\nuncaught exception (group=0x4001d940)

{html}", "attachment": [], "flagged": false, "summary": "Android: Crash when hiding Switch", "creator": { "name": "nathanielmccallum", "key": "nathanielmccallum", "displayName": "Nathaniel McCallum", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nathanielmccallum", "key": "nathanielmccallum", "displayName": "Nathaniel McCallum", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "128220", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [22eaec7f7d8c46231e08308258450575a5add5b9])\nSwitch now acts more intelligently when it's \"style\" attribute is\nchanged. Don't recreate row proxy views if the convertedView is the\nsame as the item's existing view. Remove / cleanup stale views from\nthe row proxy view when setRowData is called. added a test for\ntoggling hasChild / row proxy child views [#2344\nstate:fixed-in-qa] \nhttps://github.com/appcelerator/titanium_mobile/commit/22eaec7f7d8c...

{html}", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:17:16.000+0000", "updated": "2011-04-15T03:17:16.000+0000" }, { "id": "128221", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [e18980e31ba5c0e061da3ababd711467471bffeb])\npre-seed a relatively large number of row types so we can avoid\ncalling setAdapter to tell the ListView about new row types (which\ncauses all kinds of memory / model havoc). added a new\nforceCreateView in TiViewProxy to simply assign the internal view\nreference to a new instance, rather than forcefully tearing down\nthe existing view. this fixes the className redrawing bug when the\nListView recycler shuffles reused view instances [#1971\nstate:fixed-in-qa] [#2377 state:fixed-in-qa] [#2344]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/e18980e31ba5...

{html}", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:17:16.000+0000", "updated": "2011-04-15T03:17:16.000+0000" }, { "id": "128222", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Titanium SDK version: 1.5.0 (12/03/10 09:29 33c2058) g2 (2.2)\nsim (2.1)

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:17:16.000+0000", "updated": "2011-04-15T03:17:16.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }