{ "id": "75911", "key": "TIMOB-4348", "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" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-04-26T09:01:30.000+0000", "created": "2011-06-08T07:38:41.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-31T21:03:08.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": "If I create a scrollable view with TableViews and those TableViews have a search bar, the app crashes with the console saying:\r\n{code}\r\njava.lang.IllegalStateException: The specified child already has a parent.\r\nYou must call removeView() on the child's parent first.\r\n{code}\r\nHere is a very simple example code\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar tv = function(){\r\n\tvar data = [ {title:'1'}, {title:'2'} ];\r\n\tvar t = Ti.UI.createTableView({\r\n\t\tsearch:Ti.UI.createSearchBar({\r\n\t\t\theight:35\r\n\t\t}),\r\n\t\tdata:data\r\n\t});\r\n\t\r\n\treturn t;\r\n};\r\n\r\nvar sc = Ti.UI.createScrollableView({\r\n\tviews:[tv(), tv()]\r\n});\r\n\r\nwin.add(sc);\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android - ScrollableView + TableViews with Searchbars crashes app ", "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": "Android Emulator APIs 2.2", "comment": { "comments": [ { "id": "194912", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested on 2.0.1GA2 using a Samsung Galaxy S2, I was unable to reproduce the issue. Ticket closed.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-05-15T15:07:01.000+0000", "updated": "2012-05-15T15:07:01.000+0000" }, { "id": "195661", "author": { "name": "mgumbs", "key": "mgumbs", "displayName": "Mahlon Gumbs", "active": true, "timeZone": "America/New_York" }, "body": "\r\nGuys, this bug is only partly resolved. The issue still exist if you use the addView method of the scrollable to add \"searchable tableviews\". It looks like populating the views collection as part of the scrollable's config has been fixed, but addView still has the same problem as seen in this code example:\r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor:'#fff'\r\n});\r\n \r\nvar tv = function(){\r\n var data = [ {title:'1'}, {title:'2'} ];\r\n var t = Ti.UI.createTableView({\r\n search:Ti.UI.createSearchBar({\r\n height:35\r\n }),\r\n data:data\r\n });\r\n \r\n return t;\r\n};\r\n \r\nvar sc = Ti.UI.createScrollableView({\r\n views:[]\r\n});\r\n\r\nwin.add(sc);\r\n \r\nwin.open();\r\n\r\n//Simulate view being added as the result of a user action (perhaps a button's click event)\r\nsetTimeout(function(){\r\n\tsc.addView(tv());\r\n}, 2000);\r\n\r\n//Simulate a second view being added as the result of a user action (perhaps a button's click event)\r\nsetTimeout(function(){\r\n\tsc.addView(tv()); //<-- causes exception mentioned above\r\n}, 4000);\r\n{code}", "updateAuthor": { "name": "mgumbs", "key": "mgumbs", "displayName": "Mahlon Gumbs", "active": true, "timeZone": "America/New_York" }, "created": "2012-05-22T16:03:47.000+0000", "updated": "2012-05-22T16:03:47.000+0000" }, { "id": "195663", "author": { "name": "mgumbs", "key": "mgumbs", "displayName": "Mahlon Gumbs", "active": true, "timeZone": "America/New_York" }, "body": "Forgot to mention this latest test was done on 2.0.1GA2 using a Samsung Nexus S running Android 4.0.4.", "updateAuthor": { "name": "mgumbs", "key": "mgumbs", "displayName": "Mahlon Gumbs", "active": true, "timeZone": "America/New_York" }, "created": "2012-05-22T16:08:02.000+0000", "updated": "2012-05-22T16:08:02.000+0000" }, { "id": "195677", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopened this ticket based on the recent report.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-22T16:53:32.000+0000", "updated": "2012-05-22T16:53:32.000+0000" }, { "id": "200246", "author": { "name": "seb_logica", "key": "seb_logica", "displayName": "Sebastien", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have the same issue with addView.\r\n\r\nI think the problem is in processProperties method in TiUITableView.\r\nWhen we have a searchbar we reuse it with this line :\r\nTiUISearchBar searchBar = (TiUISearchBar)searchView.getOrCreateView();\r\n\r\nbut we always do layout.addView(searchBar.getNativeView(), p);\r\n\r\n", "updateAuthor": { "name": "seb_logica", "key": "seb_logica", "displayName": "Sebastien", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-26T03:19:21.000+0000", "updated": "2012-06-26T03:19:21.000+0000" }, { "id": "249110", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "cannot reproduce\r\n\r\nTested with\r\nTitanium Studio, build: 3.0.1.201212181159\r\nTitanium SDK version: 3.1.0\r\nAndroid Emulator: Android SDK version: 2.2 \r\n", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-26T09:01:30.000+0000", "updated": "2013-04-26T09:01:30.000+0000" }, { "id": "416541", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-31T21:03:08.000+0000", "updated": "2017-03-31T21:03:08.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }