{ "id": "159281", "key": "TIMOB-23150", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-04-13T18:04:49.000+0000", "created": "2016-04-04T08:11:34.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "eventlistener", "ios", "qe-5.4.0", "scrollableView", "tableView" ], "versions": [], "issuelinks": [], "assignee": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-06-09T22:47:15.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": "Hello,\r\n\r\nInside ScrollableView, i have added two views including some views & images. Their is a TableView & its rows in which scrollview is added.\r\n\r\nAlso i have added some EventListener's on images which are not executed in case of IOS. It's working perfectly on Android.\r\n \r\n{code:java}\r\nvar args = $.args;\r\n\r\nvar table = Ti.UI.createTableView({\r\n\teditable : 'true',\r\n\t// editing : 'true',\r\n\t//id : 'table',\r\n\tlayout : \"vertical\",\r\n\tseparatorColor : \"#1268b3\"\r\n});\r\n\r\nvar tableData = [];\r\nvar i, row, header;\r\n\r\nfor ( i = 0; i < 10; i++) {\r\n\r\n\trow = Ti.UI.createTableViewRow({\r\n\t\tid : i,\r\n\t\tlayout : 'horizontal',\r\n\t\tcolor : '#0066cc',\r\n\t\theight : '55'\r\n\t});\r\n\r\n\tvar dataView = Ti.UI.createView({\r\n\t\tlayout : 'horizontal',\r\n\t\ttop : '0'\r\n\t});\r\n\r\n\tvar textHolderView = Ti.UI.createView({\r\n\t\tlayout : 'vertical',\r\n\t\twidth : '50%'\r\n\t});\r\n\r\n\tvar iconView = Ti.UI.createView({\r\n\t\tlayout : 'horizontal',\r\n\t\twidth : '24.5%'\t//35dp\r\n\t});\r\n\r\n\theader = Ti.UI.createLabel({\r\n\t\t\t\t\ttext : \"Some Text\"+i,\r\n\t\t\t\t\tfont : {\r\n\t\t\t\t\t\tfontSize : '12dp',\r\n\t\t\t\t\t\tfontFamily : 'OpenSans-Semibold',\r\n\t\t\t\t\t\tfontWeight : 'normal'\r\n\t\t\t\t\t},\r\n\t\t\t\t\theight : '38dp',\r\n\t\t\t\t\tleft : '15%',\t\t\t\t\t\r\n\t\t\t\t\tcolor : '#000',\r\n\t\t\t\t\twidth : '85%',\r\n\t\t\t\t\ttouchEnabled : false,\r\n\t\t\t\t\t//borderColor:\"black\"\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\tvar image1 = Ti.UI.createImageView({\r\n\t\timage : \"/images/individual.png\",\r\n\t\theight : '18dp',\r\n\t\tleft : '5dp',\r\n\t\twidth : '13%',\r\n\t\ttop : '25%'\t\r\n\t});\r\n\r\n\tvar slideOptionsView = Ti.UI.createView({\r\n\t\tbackgroundColor : \"#1268b3\",\r\n\t\tlayout : \"horizontal\"\r\n\t});\r\n \r\n\tvar img_activity = Ti.UI.createImageView({\r\n\t\timage : \"/images/activity_temp.png\",\r\n\t\theight : \"30dp\",\r\n\t\twidth : \"70dp\",\r\n\t\tleft : \"10%\",\r\n\t\ttop : \"15dp\",\r\n\t\ttouchEnabled:true\r\n\t});\r\n\t\r\n\ttextHolderView.add(header);\r\n\ticonView.add(image1);\r\n\tdataView.add(textHolderView);\r\n\tdataView.add(iconView);\r\n\t\r\n\tslideOptionsView.add(img_activity);\r\n\t\r\n\tvar scroll = Ti.UI.createScrollableView({\r\n\t\t\t\t\tviews : [dataView, slideOptionsView],\r\n\t\t\t\t\tshowPagingControl : false,\t\t\t\t\t\r\n\t\t\t\t});\t\r\n\t\r\n\trow.add(scroll);\r\n\ttableData.push(row);\r\n\ttable.setData(tableData);\r\n\t\t\r\n\t// Event Listeners on click event for above images\r\n\timg_activity.addEventListener('click', function(e) {\r\n\t\talert(\"img_activity\");\r\n\t});\t\r\n\t\r\n\timage1.addEventListener('click', function(e) {\r\n\t\talert(\"image1\");\r\n\t});\t\r\n}\r\n\r\n$.visitView.add(table);\r\n$.index.open();\r\n{code}\r\n\r\n\r\nAttached some screenshots & files below.\r\n\r\n*Versions Used:*\r\nSDK 5.2.1.GA\r\nCLI 5.2.1\r\n\r\nThanks.\r\n\r\n\r\nNote:\r\nI gave a try by removing TableView & row from above code.\r\nProblem lies with ScrollableView where Listeners are not getting called on click of any image. Scroll & other Listener events are working fine.\r\n\r\n\r\n\r\n{code:java}\r\n// var table = Ti.UI.createTableView({\r\n\t// id : 'table',\r\n\t// layout : \"vertical\",\r\n\t// separatorColor : \"#1268b3\"\r\n// });\r\n\r\nvar tableData = [];\r\nvar i, header;\r\n\r\n\r\n// var row = Ti.UI.createTableViewRow({\r\n\t// id : i,\r\n\t// layout : 'horizontal',\r\n\t// color : '#0066cc',\r\n\t// height : '55'\r\n// });\r\n\r\nvar dataView = Ti.UI.createView({\r\n\tlayout : 'horizontal',\r\n\ttop : '0'\r\n});\r\n\r\nvar textHolderView = Ti.UI.createView({\r\n\tlayout : 'vertical',\r\n\twidth : '50%'\r\n});\r\n\r\nvar iconView = Ti.UI.createView({\r\n\tlayout : 'horizontal',\r\n\twidth : '24.5%'\t//35dp\r\n});\r\n\r\nheader = Ti.UI.createLabel({\r\n\ttext : \"Some Text\",\r\n\tfont : {\r\n\t\tfontSize : '12dp',\r\n\t\tfontFamily : 'OpenSans-Semibold',\r\n\t\tfontWeight : 'normal'\r\n\t},\r\n\theight : '38dp',\r\n\tleft : '15%',\r\n\tcolor : '#000',\r\n\twidth : '85%',\r\n\ttouchEnabled : false,\r\n\t//borderColor:\"black\"\r\n});\r\n\r\nvar image1 = Ti.UI.createImageView({\r\n\timage : \"/images/individual.png\",\r\n\theight : '18dp',\r\n\tleft : '5dp',\r\n\twidth : '13%',\r\n\ttop : '25%'\r\n});\r\n\r\nvar slideOptionsView = Ti.UI.createView({\r\n\tbackgroundColor : \"#1268b3\",\r\n\tlayout : \"horizontal\"\r\n});\r\n\r\nvar img_activity = Ti.UI.createImageView({\r\n\timage : \"/images/activity_temp.png\",\r\n\theight : \"30dp\",\r\n\twidth : \"70dp\",\r\n\tleft : \"10%\",\r\n\ttop : \"15dp\",\r\n\ttouchEnabled : true\r\n});\r\n\r\ntextHolderView.add(header);\r\niconView.add(image1);\r\ndataView.add(textHolderView);\r\ndataView.add(iconView);\r\n\r\nslideOptionsView.add(img_activity);\r\n\r\nvar scroll = Ti.UI.createScrollableView({\r\n\tviews : [dataView, slideOptionsView],\r\n\tshowPagingControl : false,\r\n});\r\n\r\n// row.add(scroll);\r\n// tableData.push(row);\r\n// table.setData(tableData);\r\n\r\n// Event Listeners on click for above images\r\n// img_activity.addEventListener('click', function(e) {\r\n\t// alert(\"img_activity\");\r\n// });\r\n\r\nTi.API.info(i);\r\n\r\n\t// scroll.addEventListener('click', function(e){\r\n\t\t// alert(JSON.stringify(e.source));\r\n\t// });\r\n\r\nimage1.addEventListener('click', function(e) {\r\n\talert(\"image1\");\r\n});\r\n//table\r\n$.someView.add(scroll); \r\n\r\n$.index.open();\r\n{code}", "attachment": [ { "id": "58797", "filename": "index.js", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-04-04T08:10:34.000+0000", "size": 1986, "mimeType": "text/javascript" }, { "id": "58796", "filename": "index.xml", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-04-04T08:10:34.000+0000", "size": 93, "mimeType": "text/xml" }, { "id": "58798", "filename": "Simulator Screen Shot 04-Apr-2016 1.37.49 pm.png", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-04-04T08:08:56.000+0000", "size": 51158, "mimeType": "image/png" }, { "id": "58799", "filename": "Simulator Screen Shot 04-Apr-2016 1.37.55 pm.png", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-04-04T08:08:56.000+0000", "size": 55182, "mimeType": "image/png" } ], "flagged": false, "summary": "EventListener issues in ScrollableView for IOS.", "creator": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "subtasks": [], "reporter": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "environment": null, "closedSprints": [ { "id": 618, "state": "closed", "name": "2016 Sprint 08 SDK", "startDate": "2016-04-09T00:30:18.262Z", "endDate": "2016-04-23T00:30:00.000Z", "completeDate": "2016-04-25T02:38:28.511Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "381996", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Demo Code:\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n \r\nvar table = Ti.UI.createTableView({\r\n\teditable: 'true',\r\n\t// editing : 'true',\r\n\t//id : 'table',\r\n\tlayout: \"vertical\",\r\n\tseparatorColor: \"#1268b3\"\r\n});\r\n\r\nvar tableData = [];\r\nvar i, row, header;\r\n\r\nfor (i = 0; i < 10; i++) {\r\n\r\n\trow = Ti.UI.createTableViewRow({\r\n\t\tid: i,\r\n\t\tlayout: 'horizontal',\r\n\t\tcolor: '#0066cc',\r\n\t\theight: '55'\r\n\t});\r\n\r\n\tvar dataView = Ti.UI.createView({\r\n\t\tlayout: 'horizontal',\r\n\t\ttop: '0'\r\n\t});\r\n\r\n\tvar textHolderView = Ti.UI.createView({\r\n\t\tlayout: 'vertical',\r\n\t\twidth: '50%'\r\n\t});\r\n\r\n\tvar iconView = Ti.UI.createView({\r\n\t\tlayout: 'horizontal',\r\n\t\twidth: '24.5%' //35dp\r\n\t});\r\n\r\n\theader = Ti.UI.createLabel({\r\n\t\ttext: \"Some Text\" + i,\r\n\t\tfont: {\r\n\t\t\tfontSize: '12dp',\r\n\t\t\tfontFamily: 'OpenSans-Semibold',\r\n\t\t\tfontWeight: 'normal'\r\n\t\t},\r\n\t\theight: '38dp',\r\n\t\tleft: '15%',\r\n\t\tcolor: '#000',\r\n\t\twidth: '85%',\r\n\t\ttouchEnabled: false,\r\n\t\t//borderColor:\"black\"\r\n\t});\r\n\r\n\tvar image1 = Ti.UI.createImageView({\r\n\t\timage: \"/images/campFire01.gif\",\r\n\t\theight: '18dp',\r\n\t\tleft: '5dp',\r\n\t\twidth: '13%',\r\n\t\ttop: '25%',\r\n\t\ttouchEnabled:true\r\n\t});\r\n\r\n\tvar slideOptionsView = Ti.UI.createView({\r\n\t\tbackgroundColor: \"#1268b3\",\r\n\t\tlayout: \"horizontal\"\r\n\t});\r\n\r\n\tvar img_activity = Ti.UI.createImageView({\r\n\t\timage: \"/images/campFire02.gif\",\r\n\t\theight: \"30dp\",\r\n\t\twidth: \"70dp\",\r\n\t\tleft: \"10%\",\r\n\t\ttop: \"15dp\",\r\n\t\ttouchEnabled: true\r\n\t});\r\n\r\n\ttextHolderView.add(header);\r\n\ticonView.add(image1);\r\n\tdataView.add(textHolderView);\r\n\tdataView.add(iconView);\r\n\r\n\tslideOptionsView.add(img_activity);\r\n\r\n\r\n\tvar scroll = Ti.UI.createScrollableView({\r\n\t\tviews: [dataView, slideOptionsView],\r\n\t\tshowPagingControl: false,\r\n\t});\r\n\r\n\r\n\trow.add(scroll);\r\n\ttableData.push(row);\r\n\t// Event Listeners on click event for above images\r\n\timg_activity.addEventListener('click', function(e) {\r\n\t\talert(\"img_activity\");\r\n\t});\r\n\r\n\timage1.addEventListener('click', function(e) {\r\n\t\talert(\"image1\");\r\n\t});\r\n}\r\n\r\ntable.setData(tableData);\r\ntableData = null;\r\n\r\n\r\nvar visitView = Ti.UI.createView({\r\n\tbackgroundColor: 'red'\r\n});\r\nvisitView.add(table);\r\nwin.add(visitView);\r\nwin.open();\r\n{code}\r\nPR : https://github.com/appcelerator/titanium_mobile/pull/7923", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-06T22:30:21.000+0000", "updated": "2016-04-06T22:30:21.000+0000" }, { "id": "381997", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~Suraj Datta] The PR above should fix the issue you were having :), however putting a scrollableView inside a tableView isn't the best idea , it will work most of the time however it isn't best practice and can cause native issues. ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-06T22:34:36.000+0000", "updated": "2016-04-06T22:34:58.000+0000" }, { "id": "382033", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "body": "@Angel Petkov Thanks for that fix, it's working now :D.\r\n\r\nAlso, do we need to make some similar changes for Android? It's showing some abnormalities in it.\r\n+Example:+\r\nOn 5-6 clicks on images alert is getting executed, but after that the *click* event becomes unresponsive & alert message gets executed after scrolling to 1st or 2nd view.\r\n\r\nThanks Again.", "updateAuthor": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-04-07T07:04:35.000+0000", "updated": "2016-04-07T07:04:35.000+0000" }, { "id": "382035", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~Suraj Datta] Very good to hear that it's working for you now. I think it'll be preferable to create a new ticket specific for the Android issue you described, so as not to make this ticket too bulky with excess info. Appreciate it!", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-07T07:16:34.000+0000", "updated": "2016-04-07T07:16:34.000+0000" }, { "id": "382039", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "body": "Ok it would be good to create new ticket for Android. \r\nThanks team for your help. We can close this ticket. :)", "updateAuthor": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-04-07T07:29:37.000+0000", "updated": "2016-04-07T07:29:37.000+0000" }, { "id": "382063", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I tested the issue on some aspects:\r\n\r\n*5_2_X*:\r\n- Does not work by default, but does work with `true` inside the `` section of tiapp.xml\r\n\r\n*5_4_X* (aka master):\r\n- Does work by default, because it uses main-thread by default. Disabling it manually will make it stop working\r\n\r\nRemoving the `#ifdef` Statements are no suitable solution, because it breaks several other tickets (see the PR) again, for which those macros have been introduced just this week. We will revisit this issue knowing the above facts and come up with an improved solution. Thanks guys!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-07T09:54:38.000+0000", "updated": "2016-04-07T09:55:08.000+0000" }, { "id": "382478", "author": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "body": "Hello All,\r\n\r\nThe above build code of *TiUIScrollableViewProxy.m* is working fine.\r\nSince the build file changes on some runs, i have to reconfigure the above file every time.\r\nSo do we have any permanent solution for it?\r\n\r\nThanks.", "updateAuthor": { "name": "Suraj Datta", "key": "suraj datta", "displayName": "Suraj Datta", "active": true, "timeZone": "Indian/Mahe" }, "created": "2016-04-12T15:06:58.000+0000", "updated": "2016-04-12T15:07:33.000+0000" }, { "id": "382481", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~Suraj Datta], if the PR works for you, you can patch your Ti-version in {{~/Library/Application Support/Titanium/mobilesdk/osx/}}, the long-term solution will be available in 5.4.0.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-12T15:12:09.000+0000", "updated": "2016-04-12T15:12:09.000+0000" }, { "id": "387987", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, Using the demo code provided, I receive the EventListener alerts without issue.\r\n\r\nTested On:\r\niPhone 6S (9.3.2) Device\r\nMac OSX El Capitan 10.11.5 \r\nTi SDK: 5.4.0.v20160608165242\r\nAppc Studio: 4.6.0.201605201934\r\nAppc NPM: 4.2.7.-2\r\nApp CLI: 5.4.0-11\r\nXcode 7.3\r\nNode v4.2.6\r\n*Closing ticket.*\r\n", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-06-09T22:46:49.000+0000", "updated": "2016-06-09T22:46:49.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }