{ "id": "152615", "key": "ALOY-1324", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2016-03-21T08:40:39.000+0000", "created": "2015-11-03T16:22:16.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [ { "id": "50577", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "outwardIssue": { "id": "126436", "key": "ALOY-1355", "fields": { "summary": "Alloy doesn't cast \"true\"/\"false\" attributes as booleans", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "49619", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "127619", "key": "ALOY-968", "fields": { "summary": "strings in xml on boolean values (\"false\"/\"true\") fail in mobileweb", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "batman", "key": "batman", "displayName": "Bruce Wayne", "active": true, "timeZone": "America/New_York" }, "updated": "2016-03-21T08:40:39.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": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "This is a new attempt after ALOY-968 was closed with little discussion.\r\n\r\nThe following view snippet:\r\n\r\n{code:xml}\r\n\r\n{code}\r\n\r\nWill compile to:\r\n\r\n{code:javascript}\r\n $.__views.__alloyId0 = Ti.UI.createLabel({\r\n width: Ti.UI.SIZE,\r\n height: Ti.UI.SIZE,\r\n color: \"#000\",\r\n text: \"Hello, world!\",\r\n focusable: \"false\",\r\n borderWidth: \"5\",\r\n borderColor: \"#000\",\r\n id: \"__alloyId0\"\r\n });\r\n{code}\r\n\r\nFor some properties/values (mostly Number) this is not a problem, but {{focusable: \"false\"}} will evaluate to {{true}}.\r\n\r\nOf course these could and in most cases _should_ be set in TSS which supports Boolean and Number types. However, in particular boolean flags that impact the markup/layout (show, hide, animate..) it can make sense to set them in the XML view.\r\n\r\nSimply casting all {{/^[0-9]+$/}} values to Number and all {{/^(true|false)$/}} to Boolean might break apps and will make it impossible to keep them as strings if that is in fact what you want.\r\n\r\nA workaround for Boolean values would be to set {{Alloy.Globals.TRUE = true;}} in {{alloy.js}} and then use this as value in the XML. Maybe we can introduce {{Ti.TRUE}} and {{Ti.FALSE}} as an official \"workaround\"?\r\n\r\nI must say I'm not keen on either two.. so open for other ideas.", "attachment": [], "flagged": false, "summary": "Support Boolean (and Number) values in XML views", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": null, "comment": { "comments": [ { "id": "376771", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Is partly duplicated by ALOY-1355", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-12T21:19:02.000+0000", "updated": "2016-02-12T21:19:02.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }