{ "id": "134684", "key": "ALOY-1229", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "16692", "name": "Alloy 1.7.0", "archived": false, "released": true, "releaseDate": "2015-07-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-02-06T19:10:36.000+0000", "created": "2014-08-13T16:47:23.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios", "listview", "listview,", "listviewitem", "sdk" ], "versions": [], "issuelinks": [], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2015-02-06T19:10:36.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13604", "name": "Tooling", "description": "Items related to Alloy tooling and workflow" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "The ListView is not filling out incorrectly. The first label \"#faultyLabel\" should be replace with text and have a backgroundColor=\"magenta\", but what's happening is a new label is appearing behind the next line, with its backgroundColor=\"magenta\" and the text either not displayed or displayed out of view.\r\n\r\nCreate a new Alloy project and drop the three attached files to see the issue. The ListView works correctly in Android (screenshot also attached)", "attachment": [ { "id": "50450", "filename": "index.js", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-13T16:47:23.000+0000", "size": 1218, "mimeType": "application/x-javascript" }, { "id": "50452", "filename": "index.tss", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-13T16:47:23.000+0000", "size": 553, "mimeType": "application/octet-stream" }, { "id": "50451", "filename": "index.xml", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-13T16:47:23.000+0000", "size": 591, "mimeType": "text/xml" }, { "id": "50454", "filename": "listview-android.png", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-13T16:51:47.000+0000", "size": 127366, "mimeType": "image/png" }, { "id": "50453", "filename": "listviewissue.png", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-13T16:47:23.000+0000", "size": 201657, "mimeType": "image/png" }, { "id": "54030", "filename": "Screen Shot 2015-02-06 at 1.59.46 PM.png", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2015-02-06T19:08:14.000+0000", "size": 71675, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: ListView filling template incorrectly", "creator": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "environment": "iOS7, iOS8b5, both simulator and device\r\nTiSDK 3.4.1.GA - 3.5.0.GA\r\nAlloy 1.4.1.GA - 1.5.1.GA", "closedSprints": [ { "id": 319, "state": "closed", "name": "2015 Sprint 03 Tooling", "startDate": "2015-01-31T03:56:17.033Z", "endDate": "2015-02-14T02:30:00.000Z", "completeDate": "2015-02-14T02:18:47.439Z", "originBoardId": 121 } ], "comment": { "comments": [ { "id": "318500", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "body": "Ok, I just found a workaround to this very oddly specific defect.\r\n\r\nHere’s the snippet:\r\n\r\n{code}\r\n\r\n\r\n{code}\r\n\r\nAnd in the TSS:\r\n\r\n{code}\r\n\"#faultyLabel\": {\r\nleft: 12,\r\ntext: \"dummy text\",\r\nbackgroundColor: \"yellow\",\r\nright: 12,\r\nheight: 16,\r\ncolor: \"black\",\r\nfont: {\r\nfontSize: 16,\r\nfontFamily: \"Helvetica\",\r\nfontWeight: \"bold\"\r\n}\r\n}\r\n\"#otherView\": {\r\nleft: 0,\r\nright: 0,\r\ntop: 40,\r\nheight: 20,\r\n}\r\n{code}\r\n\r\nHere’s what I did:\r\n\r\n1) I removed the wrapper view that has the vertical layout. \r\n2) Instead of using the vertical layout, I laid out the elements by hand.\r\n\r\nThis issue does not affect any Labels in the ElementsOfListView app, so there is something very oddly specific about the arrangement of the Labels and Views with layouts that is tripping this defect.\r\n\r\nI am reducing the severity in light of this workaround.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-13T18:28:54.000+0000", "updated": "2014-08-25T21:07:13.000+0000" }, { "id": "319326", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "body": "The client has requested this be fixed in the next or next-to-next SDK release.", "updateAuthor": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-19T18:59:51.000+0000", "updated": "2014-08-19T18:59:51.000+0000" }, { "id": "320199", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~twilkinson] Is it possible to get a non-Alloy test case for this?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-25T21:09:23.000+0000", "updated": "2014-08-25T21:09:23.000+0000" }, { "id": "320202", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "body": "Besides grabbing the compiled code from the Resources directory? I should have some bandwidth at the end of this week.", "updateAuthor": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-25T21:15:31.000+0000", "updated": "2014-08-25T21:15:31.000+0000" }, { "id": "320214", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, the compiled code can be difficult to review. If you can simplify it, that would be great.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-25T21:38:47.000+0000", "updated": "2014-08-25T21:38:47.000+0000" }, { "id": "339790", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "h6. The issue seems to be related to the usage of the 'touchEnabled' property on the parent View inside the ItemTemplate. \r\nJust by removing \"touchEnabled=false\" from id=\"outerView\" View in index.html, it's then being displayed fine also on iOS.\r\n\r\nFurther investigation results:\r\n\r\nh4. 1.\r\nSee the following modified version of index.xml. I have set a touchEnabled=\"false\" in the top view in the ItemTemplate (the one with id=\"outerView\"), as well as added a custom property and layout=\"vertical\" :\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nIn this case the compiled /alloy/controllers/index.js file would include:\r\n{code}\r\nvar __alloyId4 = {\r\n type: \"Ti.UI.View\",\r\n childTemplates: function() {\r\n var __alloyId5 = [];\r\n var __alloyId6 = {\r\n type: \"Ti.UI.Label\",\r\n bindId: \"faultyLabel\",\r\n properties: {\r\n left: 12,\r\n text: \"dummy text\",\r\n backgroundColor: \"yellow\",\r\n right: 12,\r\n height: 16,\r\n color: \"black\",\r\n font: {\r\n fontSize: 16,\r\n fontFamily: \"Helvetica\",\r\n fontWeight: \"bold\"\r\n },\r\n touchEnabled: false,\r\n customProp: \"foobar\",\r\n layout: \"vertical\",\r\n bindId: \"faultyLabel\"\r\n }\r\n };\r\n __alloyId5.push(__alloyId6);\r\n var __alloyId7 = {\r\n type: \"Ti.UI.View\",\r\n childTemplates: function() {\r\n var __alloyId8 = [];\r\n var __alloyId9 = {\r\n type: \"Ti.UI.Label\",\r\n properties: {\r\n left: 12,\r\n width: 150,\r\n text: \"Opening Available\",\r\n height: 20,\r\n touchEnabled: false,\r\n customProp: \"foobar\",\r\n layout: \"vertical\",\r\n bindId: \"faultyLabel\"\r\n }\r\n };\r\n __alloyId8.push(__alloyId9);\r\n var __alloyId10 = {\r\n type: \"Ti.UI.Label\",\r\n bindId: \"otherViewLabel2\",\r\n properties: {\r\n right: 0,\r\n width: 150,\r\n textAlign: \"right\",\r\n height: 20,\r\n touchEnabled: false,\r\n customProp: \"foobar\",\r\n layout: \"vertical\",\r\n bindId: \"faultyLabel\"\r\n }\r\n };\r\n __alloyId8.push(__alloyId10);\r\n return __alloyId8;\r\n }(),\r\n properties: {\r\n left: 0,\r\n right: 0,\r\n height: 20,\r\n touchEnabled: false,\r\n customProp: \"foobar\",\r\n layout: \"vertical\",\r\n bindId: \"faultyLabel\"\r\n }\r\n };\r\n __alloyId5.push(__alloyId7);\r\n return __alloyId5;\r\n }(),\r\n properties: {\r\n left: 0,\r\n right: 0,\r\n height: Ti.UI.SIZE,\r\n touchEnabled: false,\r\n customProp: \"foobar\",\r\n layout: \"vertical\"\r\n }\r\n };\r\n __alloyId3.push(__alloyId4);\r\n var __alloyId2 = {\r\n properties: {\r\n name: \"faultyTemplate\"\r\n },\r\n childTemplates: __alloyId3\r\n };\r\n __alloyId0[\"faultyTemplate\"] = __alloyId2;\r\n $.__views.section = Ti.UI.createListSection({\r\n id: \"section\"\r\n });\r\n{code} \r\n\r\nIn this case, the bindId: \"faultyLabel\" and other properties (customProp=\"foobar\" layout=\"vertical\" touchEnabled=\"false\") are also applied to the children objects of the top view in the ItemTemplate.\r\n\r\nh4. 2.\r\nIn the compiled code, also, bindId is being set inside the \"properties\" in the object and it seems this is the value being used when building on iOS (hence the issue reported originally in the ticket).\r\nAbout this, see how the \"otherViewLabel2\" is being compiled:\r\n{code}\r\n