{ "id": "166812", "key": "TIMOB-24538", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-05-19T14:14:19.000+0000", "created": "2017-03-27T20:52:25.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-05-19T14:16:47.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": "There are properties like \"badge\" and \"constants\" that are private API of the {{UITableViewCell}}, which we subclass with our {{TiUIListItem}}. Setting the bindId to those values and trying to update the underlaying key-paths afterwards will cause a crash like \"this class is not key value coding-compliant for the key color.\" which doesn't say anything to the Titanium developer. Instead, we should show a modal error saying \"The bindId \"\" is reserved by the system, please choose a different name and try again.\". Easy one.", "attachment": [], "flagged": false, "summary": "iOS: Setting Ti.UI.ListItem \"bindId\" property to reserved identifier should fail gracefully", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "415937", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/8912", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-27T20:59:10.000+0000", "updated": "2017-03-27T20:59:10.000+0000" }, { "id": "416817", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel] Can you give a Test Case ?\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-05T04:10:01.000+0000", "updated": "2017-04-05T04:10:01.000+0000" }, { "id": "416865", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "You can just create a new list item template and name it with a reserved. I had a test-case and list of reserved words I tested with, but I forgot it. Let me provide it again tomorrow. *EDIT*: Try the bindId {{badge}} and set a {{text}} to it. It will try to set [this property|https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/UIKit.framework/UITableViewCell.h#L19] (which is a pretty nice property and stuff, but still private API causing the crash.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-05T18:02:02.000+0000", "updated": "2017-04-07T17:11:13.000+0000" }, { "id": "417167", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test Case:\r\n\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar myTemplate = {\r\n childTemplates: [{\r\n type: 'Ti.UI.Label',\r\n bindId: 'badge',\r\n properties: {\r\n height: 100,\r\n width:200\r\n }\r\n }]\r\n};\r\n\r\nvar list = Ti.UI.createListView({\r\n templates:{'template':myTemplate},\r\n defaultItemTemplate: 'template',\r\n});\r\nvar sections = [];\r\nvar imgSection = Ti.UI.createListSection({headerTitle:'Test Image Template'});\r\nvar listItems = [];\r\nfor (var i = 0; i < 5; i++) {\r\n listItems.push({badge:\r\n {image : 'image.JPG'}\r\n });\r\n}\r\nimgSection.setItems(listItems);\r\nsections.push(imgSection);\r\nlist.setSections(sections);\r\nwin.add(list);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-11T07:33:39.000+0000", "updated": "2017-04-11T07:33:39.000+0000" }, { "id": "420034", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, when using a reserved identifier (i.e. 'badge') for the bindId property of a ListItem an error splash screen detailing the issue is prompted.\r\n\r\niPhone 7 10.2 Device & Simulator\r\niPhone 5S 9.3.5 Simulator\r\nMac OS Sierra (10.12.2)\r\nAppc NPM: 4.2.9-1\r\nApp CLI: 6.1.0\r\nXcode 8.2.1\r\nNode v4.6.0\r\n\r\n*Closing Ticket.*", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2017-05-19T14:16:38.000+0000", "updated": "2017-05-19T14:16:38.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }