{ "id": "62210", "key": "TIMOB-1578", "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": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2012-07-25T16:49:17.000+0000", "created": "2011-04-15T02:56:33.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [], "versions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "issuelinks": [ { "id": "19386", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-26T22:22:27.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": "{html}
Using the code below,
\r\n1.launch the app, tap \"remove view 3\"
\r\n2.note the view was removed, tap the button again
\r\nresults:view 2 seems to have been removed as well as objects on\r\nit.
var win = Titanium.UI.currentWindow
\r\n//create view to show var view1 =\r\nTitanium.UI.createView({backgroundColor:'#123'});
\r\nvar view2 = Titanium.UI.createView({backgroundColor:'#456'});
\r\nvar view3 = Titanium.UI.createView({backgroundColor:'#789'});
\r\n//create scrollable to be populated by above var scrollView =\r\nTitanium.UI.createScrollableView({
\r\nviews:[view1,view2,view3],\r\nshowPagingControl:true
\r\n
\r\n});
\r\n//buttons for test var b1 = Ti.UI.createButton({
\r\nheight:40,\r\nwidth:200,\r\ntitle:'Remove View 3',\r\ntop:160
\r\n
\r\n});
\r\nview1.add(b1);
\r\nvar text1 = Ti.UI.createLabel({
\r\ntext:\"view 1\",\r\nwidth:\"auto\",\r\nheight:\"auto\",\r\ntop:10,
\r\n
\r\n})
\r\nview1.add(text1)
\r\nvar text = Ti.UI.createLabel({
\r\ntext:\"view 2\",\r\nwidth:\"auto\",\r\nheight:\"auto\",\r\ntop:10,
\r\n
\r\n})
\r\nview2.add(text)
\r\nvar text3 = Ti.UI.createLabel({
\r\ntext:\"view 3\",\r\nwidth:\"auto\",\r\nheight:\"auto\",\r\ntop:10,
\r\n
\r\n})
\r\nview3.add(text3)
\r\n//remove view3 b1.addEventListener('click', function()
\r\n{
\r\nscrollView.removeView(view3);
\r\n
\r\n});
\r\nwin.add(scrollView);
formatting got hoopty above, trying again...
\nvar win = Titanium.UI.currentWindow
\nvar view1 =\nTitanium.UI.createView({backgroundColor:'#123'});
\nvar view2 = Titanium.UI.createView({backgroundColor:'#456'});
\nvar view3 = Titanium.UI.createView({backgroundColor:'#789'});
var scrollView = Titanium.UI.createScrollableView({
\nviews:[view1,view2,view3],\nshowPagingControl:true
\n
\n});
\nvar b1 = Ti.UI.createButton({
\nheight:40,\nwidth:200,\ntitle:'Remove View 3',\ntop:160
\n
\n});
\nview1.add(b1);
\nvar b2 = Ti.UI.createButton({
\nheight:40,\nwidth:210,\ntitle:'Remove View no target',\ntop:210
\n
\n});
\nview1.add(b2);
\nvar text1 = Ti.UI.createLabel({
\ntext:\"view 1\",\nwidth:\"auto\",\nheight:\"auto\",\ntop:10,
\n
\n})
\nview1.add(text1)
\nvar text = Ti.UI.createLabel({
\ntext:\"view 2\",\nwidth:\"auto\",\nheight:\"auto\",\ntop:10,
\n
\n})
\nview2.add(text)
\nvar text3 = Ti.UI.createLabel({
\ntext:\"view 3\",\nwidth:\"auto\",\nheight:\"auto\",\ntop:10,
\n
\n})
\nview3.add(text3)
\nb1.addEventListener('click', function()
\n{
\nscrollView.removeView(view3);
\n
\n});
\nb2.addEventListener('click', function()
\n{
\nscrollView.removeView();
\n
\n});
\nwin.add(scrollView);
I have recoded this page to test the issue more fully and also\nto remove the syntax errors.
\nOn Android emulator this code seems to work without issue, and\ncertainly not the issue you have described.
\nWould you run this code in your environment to confirm that it\nis still and issue for you?
\n\nvar win = Titanium.UI.currentWindow;\n\nvar view0 = Titanium.UI.createView({backgroundColor:'#123'});\n\nvar text0 = Ti.UI.createLabel({\n text:\"view 0\",\n width:\"auto\",\n height:\"auto\",\n top:10\n});\n\nview0.add(text0);\n\nvar b0 = Ti.UI.createButton({\n height:40,\n width:200,\n title:'Remove/Add View 2',\n top:140\n});\n\nview0.add(b0);\n\nvar b1 = Ti.UI.createButton({\n height:40,\n width:200,\n title:'Remove View 2',\n top:200\n});\n\nview0.add(b1);\n\nvar view1 = Titanium.UI.createView({backgroundColor:'#456'});\n\nvar text1 = Ti.UI.createLabel({\n text:\"view 1\",\n width:\"auto\",\n height:\"auto\",\n top:10\n});\n\nview1.add(text1);\n\nvar view2 = Titanium.UI.createView({backgroundColor:'#789'});\n\nvar text2 = Ti.UI.createLabel({\n text:\"view 2\",\n width:\"auto\",\n height:\"auto\",\n top:10\n});\n\nview2.add(text2);\n\nvar state = true;\n\nb0.addEventListener('click', function()\n{\n if(state){\n scrollableView.removeView(view2);\n Ti.API.info('view 2 removed');\n state = false;\n } else {\n scrollableView.addView(view2);\n Ti.API.info('view 2 added');\n state = true;\n }\n});\n\nvar removeNumber = 0;\nb1.addEventListener('click', function()\n{\n scrollableView.removeView(view2);\n removeNumber++;\n state = false;\n Ti.API.info('removing view 2 for time: '+removeNumber);\n});\n\nvar scrollableView = Titanium.UI.createScrollableView({\n views:[view0,view1,view2]\n});\n\nscrollableView.addEventListener('scroll', function(e){\n Ti.API.info('***************************************');\n Ti.API.info('scrollable view scroll currentPage: '+e.currentPage);\n});\n\nwin.add(scrollableView);
\n