{ "id": "108626", "key": "AC-2557", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-02-06T20:51:01.000+0000", "created": "2013-01-28T13:09:04.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41: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": "Reproduction steps:\r\n\r\n1. Create views for a ScrollableView (3 views, for example)\r\n2. Create a ScrollableView with thees views\r\n3. Create a new view and add this view to the ScrollableView using the function addView()\r\n4. Try to navigate into the new view.\r\n\r\nExpected behavior:\r\nView appears on the screen after setting the view number into the currentPage property.\r\n\r\nActual behavior:\r\nBlack screen appears instead of the requested view.\r\n\r\nExample:\r\n\r\n{code}var win = Ti.UI.createWindow();\r\n\r\n// Step 1\r\n\r\nvar view1 = Ti.UI.createView({ backgroundColor:'#123' });\r\nvar view2 = Ti.UI.createView({ backgroundColor:'#246' });\r\nvar view3 = Ti.UI.createView({ backgroundColor:'#48b' });\r\n\r\n// Step 2\r\n\r\nvar scrollableView = Ti.UI.createScrollableView({\r\n views:[view1,view2,view3],\r\n showPagingControl:true\r\n});\r\n\r\nwin.add(scrollableView);\r\nwin.open();\r\n\r\n// Step 3\r\n\r\nvar viewYellow = Ti.UI.createView({ backgroundColor: \"yellow\"});\t\r\nscrollableView.addView(viewYellow);\r\n\r\n// Step 4\r\n\r\nscrollableView.currentPage = 3;{code}", "attachment": [], "flagged": false, "summary": "MobileWeb: cannot navigate in ScrollableView after adding a view", "creator": { "name": "ypidstryhach_gl", "key": "ypidstryhach_gl", "displayName": "Yaroslav Pidstryhach", "active": true, "timeZone": "Europe/Helsinki" }, "subtasks": [], "reporter": { "name": "ypidstryhach_gl", "key": "ypidstryhach_gl", "displayName": "Yaroslav Pidstryhach", "active": true, "timeZone": "Europe/Helsinki" }, "environment": "MS Windows, Titanium Studio 3.0.0, MW SDK 3.0.1, Chrome simulator or a Webkit mobile browser", "comment": { "comments": [ { "id": "237499", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It seems as though when you set the views using the \"views:\" property, and then later add a view using the add method, the added view goes to the front of the index. I changed your code to something that fixes the problem and keeps your code more consistent. If you always use the .add() then I dont think you should have a problem. It is always advised to use the .add() function when wanted to add views to something and not use the views: property since it does not react well if you need to change (add or remove) the views in the future. Try this: \n\n~~~\nvar win = Ti.UI.createWindow();\n \n// Step 1\n \nvar view1 = Ti.UI.createView({ backgroundColor:'#123' });\nvar view2 = Ti.UI.createView({ backgroundColor:'#246' });\nvar view3 = Ti.UI.createView({ backgroundColor:'#48b' });\n \n// Step 2\n \nvar scrollableView = Ti.UI.createScrollableView({\n //views:[view1,view2,view3],\n showPagingControl:true,\n layout: 'vertical'\n});\n \nscrollableView.add(view1);\nscrollableView.add(view2);\nscrollableView.add(view3);\n \nwin.add(scrollableView);\nwin.open();\n \n// Step 3\n \nvar viewYellow = Ti.UI.createView({ backgroundColor: \"yellow\"}); \nscrollableView.addView(viewYellow);\n \n// Step 4\n \nscrollableView.currentPage = 3;\n~~~\n\nand your code works as expected. Do not use the views property to add views and then use a .add as the inconsistency will cause problems. \n\nRegards,\n\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-06T20:50:05.000+0000", "updated": "2013-02-06T20:50:05.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }