{ "id": "83073", "key": "AC-2728", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-12-29T05:00:05.000+0000", "created": "2011-11-24T04:01:03.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "updated": "2016-03-08T07:47:37.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "In iOS, we've been using this piece of code to insert a view into a {{ScrollableView}} before the last element:\r\n{code}\r\n/* initialize default window */\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\nwin.open();\r\n\r\n/* initialize ScrollableView */\r\nvar sv = Ti.UI.createScrollableView({\r\n\tviews: [Ti.UI.createView({backgroundColor: 'red'})]\r\n});\r\nwin.add(sv);\r\n\r\n/* actual test */\r\nvar views = sv.views;\r\ntry {\r\n\tviews.splice(views.length - 1, 0, Ti.UI.createView({backgroundColor: 'green'}));\r\n} catch (e) {\r\n\tTi.API.error(String.format(\"Exeption: %s\", e));\r\n}\r\nsv.views = views;\r\n{code}\r\n\r\nNow, on Android the {{splice()}} call in the code yields this exception: {{\"Cannot find default value for object.\"}}\r\n\r\nThis forces us to create a temporary array, populate it and then set the new array as the view array of the {{ScrollableView}}:\r\n\r\n{code}\r\nvar views = [];\r\nfor(var i = 0; i < sv.views.length; i++) {\r\n\tviews.push(sv.views[i]);\r\n}\r\nviews.splice(views.length - 1, 0, Ti.UI.createView({backgroundColor: 'green'}));\r\nsv.views = views;\r\n{code}\r\n\r\nThis code is more verbose than necessary, it may introduce bugs (e.g. typos) and it is inconsistent with the behavior on iOS. Please fix.", "attachment": [], "flagged": false, "summary": "Titanium.UI.ScrollableView.views is immutable on Android", "creator": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Mac OS X 10.6.8\r\nJava 1.6.0_29\r\nTitanium Studio 1.0.6.201110251616\r\nTitanium Mobile 1.2.0 1.5.1 1.6.0 1.6.1 1.6.2 1.7.1 1.7.2 1.7.5\r\nAndroid SDK Tools rev15\r\nAndroid SDK Platform-tools rev9\r\nAndroid 2.2 (API 8) SDK Platform rev3\r\nAndroid 2.2 (API 8) Samples for SDK rev1\r\nAndroid 2.2 (API 8) Google APIs by Google Inc. rev2", "comment": { "comments": [ { "id": "177545", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Thanks for raising this ticket.\r\n\r\nIn order for me to escalate it to the core team, all the fields must be complete. Please check it against the [JIRA Ticket Checklist|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist], and add any missing information.\r\n\r\nFurthermore, a test case must run without modification, as per the [Creating a Test Case|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-CreatingaTestCase] section.\r\n\r\nI will mark this resolved for now. Please reopen it once it is complete, and I will move it to the main project.\r\n\r\nCheers", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-12-29T04:59:57.000+0000", "updated": "2011-12-29T04:59:57.000+0000" }, { "id": "177831", "author": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "Updated the code example to be standalone.", "updateAuthor": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-01-03T02:29:33.000+0000", "updated": "2012-01-03T02:29:33.000+0000" }, { "id": "177832", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Sven\r\n\r\nI have tested this, and it has been fixed in 1.8.0.1.\r\n\r\nBe aware for future that the environment field should only contain the versions of each component that exhibits the issue. Hence, only include the versions that you have physically tested.\r\n\r\nCheers\r\n", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-03T03:13:14.000+0000", "updated": "2012-01-03T03:13:14.000+0000" }, { "id": "183557", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist] to ensure that we can escalate it quickly. Read [How to Submit a Bug Report|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report] if you have not read it before, and always start a ticket using the [JIRA Ticket Template|https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template].\r\n\r\nThanks in advance", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-02-17T02:23:09.000+0000", "updated": "2012-02-17T02:23:09.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }