{ "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.

\r\n

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\n
\r\nviews:[view1,view2,view3],\r\nshowPagingControl:true\r\n
\r\n

});

\r\n

//buttons for test var b1 = Ti.UI.createButton({

\r\n
\r\nheight:40,\r\nwidth:200,\r\ntitle:'Remove View 3',\r\ntop:160\r\n
\r\n

});

\r\n

view1.add(b1);

\r\n

var text1 = Ti.UI.createLabel({

\r\n
\r\ntext:\"view 1\",\r\nwidth:\"auto\",\r\nheight:\"auto\",\r\ntop:10,\r\n
\r\n

})

\r\n

view1.add(text1)

\r\n

var text = Ti.UI.createLabel({

\r\n
\r\ntext:\"view 2\",\r\nwidth:\"auto\",\r\nheight:\"auto\",\r\ntop:10,\r\n
\r\n

})

\r\n

view2.add(text)

\r\n

var text3 = Ti.UI.createLabel({

\r\n
\r\ntext:\"view 3\",\r\nwidth:\"auto\",\r\nheight:\"auto\",\r\ntop:10,\r\n
\r\n

})

\r\n

view3.add(text3)

\r\n

//remove view3 b1.addEventListener('click', function()
\r\n{

\r\n
\r\nscrollView.removeView(view3);\r\n
\r\n

});

\r\n

win.add(scrollView);

{html}", "attachment": [], "flagged": false, "summary": "iOS: Trying to remove a previously removed view from a scrollableView has unexpected results", "creator": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "126103", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

formatting got hoopty above, trying again...

\n

var win = Titanium.UI.currentWindow

\n

var view1 =\nTitanium.UI.createView({backgroundColor:'#123'});
\nvar view2 = Titanium.UI.createView({backgroundColor:'#456'});
\nvar view3 = Titanium.UI.createView({backgroundColor:'#789'});

\n

var scrollView = Titanium.UI.createScrollableView({

\n
\nviews:[view1,view2,view3],\nshowPagingControl:true\n
\n

});

\n

var b1 = Ti.UI.createButton({

\n
\nheight:40,\nwidth:200,\ntitle:'Remove View 3',\ntop:160\n
\n

});

\n

view1.add(b1);

\n

var b2 = Ti.UI.createButton({

\n
\nheight:40,\nwidth:210,\ntitle:'Remove View no target',\ntop:210\n
\n

});

\n

view1.add(b2);

\n

var text1 = Ti.UI.createLabel({

\n
\ntext:\"view 1\",\nwidth:\"auto\",\nheight:\"auto\",\ntop:10,\n
\n

})

\n

view1.add(text1)

\n

var text = Ti.UI.createLabel({

\n
\ntext:\"view 2\",\nwidth:\"auto\",\nheight:\"auto\",\ntop:10,\n
\n

})

\n

view2.add(text)

\n

var text3 = Ti.UI.createLabel({

\n
\ntext:\"view 3\",\nwidth:\"auto\",\nheight:\"auto\",\ntop:10,\n
\n

})

\n

view3.add(text3)

\n

b1.addEventListener('click', function()
\n{

\n
\nscrollView.removeView(view3);\n
\n

});

\n

b2.addEventListener('click', function()
\n{

\n
\nscrollView.removeView();\n
\n

});

\n

win.add(scrollView);

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:56:34.000+0000", "updated": "2011-04-15T02:56:34.000+0000" }, { "id": "126104", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I have recoded this page to test the issue more fully and also\nto remove the syntax errors.

\n

On Android emulator this code seems to work without issue, and\ncertainly not the issue you have described.

\n

Would 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
{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:56:34.000+0000", "updated": "2011-04-15T02:56:34.000+0000" }, { "id": "209462", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Unable to reproduce described behavior via any of the provided tests in SDK 2.2.0.f9e938d on iPhone Sim 5.1.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-25T16:49:17.000+0000", "updated": "2012-07-25T16:49:17.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }