{ "id": "119504", "key": "TIMOB-15101", "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": "15715", "description": "2013 Sprint 25", "name": "2013 Sprint 25", "archived": true, "released": true, "releaseDate": "2013-12-13" }, { "id": "15716", "description": "2013 Sprint 25 API", "name": "2013 Sprint 25 API", "archived": true, "released": true, "releaseDate": "2013-12-13" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-12-08T20:20:34.000+0000", "created": "2013-09-05T11:08:10.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "dev-invalidate", "ipass1", "listview", "scrollableView", "scrollablescrollable", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-28T20:24:43.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": "*Problem description*\r\nIf you use a ScrollableView in a ListView, it has a bug.\r\nBy default, in every item I show the first image of ScrollableView (currentPage = 0). After the scroll in any one of ScrollableViews, if then I scroll the ListView, many other ScrollableViews will have changed the image. Even if I try to reload the ListView, it will not show the first image of ScrollableView in all items.\r\n\r\n*Test case*\r\nThis is a generic code that reproduces the problem:\r\n{code:javascript} \r\nvar win = Ti.UI.createWindow();\r\nvar remoteImages = true; // false for localImages\r\n\r\n//--> UI ELEMENTS\r\n//\t-> ListView Template\r\nvar itemTemplate = {\r\n childTemplates: [\r\n {\r\n type: 'Ti.UI.View', \r\n bindId: 'bgView', \r\n properties: { \r\n\t\t\t\twidth : \"100%\",\r\n\t\t\t\theight : \"100%\",\r\n\t\t\t\tbackgroundColor : \"#aabbcc\",\r\n\t\t\t\tzIndex : 1 \r\n } \t\r\n },\r\n {\r\n type: 'Ti.UI.ScrollableView', \r\n bindId: 'imagesSV', \r\n properties: {\r\n\t\t\t\twidth : \"100%\",\r\n\t\t\t\theight : \"210dp\",\r\n\t\t\t\tshowPagingControl : true,\r\n\t\t\t\tcurrentPage : 0,\r\n\t\t\t\tzIndex : 2\r\n }\r\n\t\t}\r\n\t]\r\n};\r\n\r\nvar itemsLV = Ti.UI.createListView({\r\n\t\ttop : \"50dp\",\r\n\t\tbottom : \"0dp\",\r\n\t\ttemplates : {'itemTemplate': itemTemplate},\r\n\t\tdefaultItemTemplate : 'itemTemplate',\r\n\t\tbackgroundColor : \"transparent\",\r\n\t\tseparatorColor : \"transparent\"\r\n});\t\r\n\r\n\r\nvar reloadBtn = Ti.UI.createButton({\r\n\ttitle : \"Reload\",\r\n\ttop : \"5dp\"\r\n});\r\nreloadBtn.addEventListener(\"click\", function(){\r\n\treload();\r\n});\r\n\r\nvar loadingAI = Ti.UI.createActivityIndicator();\r\n\t\r\nvar reload = function(){\r\n\t\r\n\titemsLV.visible = false;\r\n\titemsLV.sections = [];\r\n\tloadingAI.show();\r\n\t\r\n\tvar data = [];\r\n\tfor(var j=0; j<100; j++){\r\n\r\n\t\tvar images = [];\r\n\t\tif(remoteImages){\r\n\t\t\tvar imagesUrl = [\r\n\t\t\t\t\"https://si0.twimg.com/profile_images/3170725828/ac1d6621fc3c3ecaa541d8073d4421cc.jpeg\",\r\n\t\t\t\t\"http://blogs.dallasobserver.com/sportatorium/No.%202.png\",\r\n\t\t\t\t\"http://dt1lqdui5w8vj.cloudfront.net/9/images/badge3.png\",\r\n\t\t\t\t\"http://www.tanialuiz.com/tania/images/stories/virtuemart/product/661dd600899aee2c6b69060aabcf54ab.png\",\r\n\t\t\t\t\"https://si0.twimg.com/profile_images/2797666136/a7030f51e405cde3684cb7bc46107736.png\",\r\n\t\t\t\t\"http://www.i2symbol.com/images/symbols/style-digits/circled_digit_six_u2465_icon_256x256.png\"\r\n\t\t\t];\r\n\t\t}else{\r\n\t\t\tvar imagesUrl = [\r\n\t\t\t\t\"/KS_nav_views.png\",\r\n\t\t\t\t\"/KS_nav_ui.png\",\r\n\t\t\t\t\"/KS_nav_views.png\",\r\n\t\t\t\t\"/KS_nav_ui.png\",\r\n\t\t\t\t\"/KS_nav_views.png\",\r\n\t\t\t\t\"/KS_nav_ui.png\"\r\n\t\t\t];\t\t\t\r\n\t\t};\r\n\t\t\r\n\t\tfor(var i in imagesUrl){\r\n\t\t\timages.push(Ti.UI.createImageView({\r\n\t\t\t\timage : imagesUrl[i],\r\n\t\t\t\tdefaultImage : \"/KS_nav_views.png\"\r\n\t\t\t}));\r\n\t\t};\r\n\t\t\r\n\t data.push({\r\n\t properties : {\r\n\t itemId: 'image n. ' + (i + 1),\r\n\t accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE,\r\n\t\t\t\tselectionStyle : Ti.UI.iPhone.ListViewCellSelectionStyle.NONE,\r\n\t\t\t\theight : \"210dp\"\r\n\t },\r\n\t bgView : {},\r\n\t imagesSV :{\r\n\t \tviews : images,\r\n\t \tcurrentPage : 0\r\n \t\t}\r\n\t });\r\n\t };\t\r\n\t\r\n var section = Ti.UI.createListSection({items: data});\r\n itemsLV.sections = [section];\r\n itemsLV.visible = true;\r\n loadingAI.hide();\t\r\n};\r\nreload();\r\n\r\n//--> ADD TO WIN\r\nwin.add(reloadBtn);\r\nwin.add(itemsLV);\r\nwin.add(loadingAI);\r\n\r\nwin.open();\r\n{code} ", "attachment": [], "flagged": false, "summary": "ScrollableView in ListView's items, causes a bug after the scroll of any ScrollableView", "creator": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium Studio 3.1.2\r\nTitanium SDK 3.1.2 GA\r\nMAC OSX 10.7.5\r\niOS", "comment": { "comments": [ { "id": "270462", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello,\n\nin general we don't recommend scrollable items on top of other scrollable items. Does this happen in simulator or device? Which iOS version?\n\nBest,\n\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-09-09T22:23:50.000+0000", "updated": "2013-09-09T22:23:50.000+0000" }, { "id": "270553", "author": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hello,\r\nI first tried using the TableView instead of the ListView. In that case there was no problem, but the scroll was too slow. So I chose to use the ListView, which has greatly improved the performance. The only problem is what I described in the issue.\r\nThe problem appears both in the simulator (6.1) and in the device (iPhone 4s 6.1.3).\r\n\r\nRegards,\r\nVittorio", "updateAuthor": { "name": "astrovicapps", "key": "astrovicapps", "displayName": "Vittorio Sorbera", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-09-10T07:56:38.000+0000", "updated": "2013-09-10T07:56:38.000+0000" }, { "id": "283133", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The list view is a data based API. When the scrollable views property changes in response to user action, it is the developers responsibility to change the associated data. Try adding a scrollend event handler to the template as shown below and things should work as expected.\r\n\r\n{code}\r\nfunction scrollHandler(e)\r\n{\r\n Ti.API.info(e.sectionIndex+' '+e.itemIndex+' '+e.bindId+' '+e.currentPage);\r\n if (e.bindId == 'imagesSV') {\r\n var section = itemsLV.sections[e.sectionIndex];\r\n var data = section.getItemAt(e.itemIndex);\r\n Ti.API.info('OLD CURRENT PAGE '+data.imagesSV.currentPage);\r\n data.imagesSV.currentPage = e.currentPage;\r\n Ti.API.info('NEW CURRENT PAGE '+data.imagesSV.currentPage);\r\n section.updateItemAt(e.itemIndex,data,{animated:false});\r\n }\r\n\r\n}\r\n\r\nvar itemTemplate = {\r\n childTemplates: [\r\n {\r\n type: 'Ti.UI.View', \r\n bindId: 'bgView', \r\n properties: { \r\n width : \"100%\",\r\n height : \"100%\",\r\n backgroundColor : \"#aabbcc\",\r\n zIndex : 1 \r\n } \r\n },\r\n {\r\n type: 'Ti.UI.ScrollableView', \r\n bindId: 'imagesSV', \r\n properties: {\r\n width : \"100%\",\r\n height : \"210dp\",\r\n showPagingControl : true,\r\n currentPage : 0,\r\n zIndex : 2\r\n }\r\n }\r\n ],\r\n events:{scrollend:scrollHandler}\r\n};\r\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-08T20:20:34.000+0000", "updated": "2013-12-08T20:20:34.000+0000" }, { "id": "416035", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T20:24:43.000+0000", "updated": "2017-03-28T20:24:43.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }