{ "id": "151694", "key": "AC-1661", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2015-10-28T01:04:43.000+0000", "created": "2015-10-02T18:59:59.000+0000", "labels": [], "versions": [ { "id": "17033", "name": "Appcelerator Studio 4.3.1", "archived": false, "released": false } ], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:38:09.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": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." } ], "description": "Attempting to use attributed strings within a label on a ListView template causes compiler errors.\r\n\r\nNormally, an attributed string can exist within a label like so:\r\n\r\n{{\r\n \r\n \r\n \r\n}}\r\n\r\nHere is the code I wrote as an example of this issue:\r\n\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\r\n\t\t\t\r\n\t\t\r\n\t\r\n}}\r\n\r\nThis code causes the following compiler errors:\r\n\r\n[INFO] : [index.xml] view processing...\r\n[INFO] : style: \"index.tss\"\r\n[INFO] : view: \"index.xml\"\r\n[DEBUG] : /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.Label.js:20\r\n[DEBUG] : \t\t\t\t\tattributedStringsymbol = state.parent.symbol;\r\n[DEBUG] : \t\t\t\t\t ^\r\n[ERROR] : : Cannot read property 'symbol' of undefined\r\n[DEBUG] : at Object.CU.generateNodeExtended.post (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.Label.js:20:43)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/base.js:14:17)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/default.js:10:27)\r\n[DEBUG] : at parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.AttributedString.js:32:39)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/base.js:11:17)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.AttributedString.js:10:27)\r\n[DEBUG] : at Object.exports.generateNode (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:317:48)\r\n[DEBUG] : at Object.exports.generateNodeExtended (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:254:17)\r\n[DEBUG] : at /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.Label.js:17:15\r\n[DEBUG] : at Array.forEach (native)\r\n[DEBUG] : at Function._.each._.forEach (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/lib/alloy/underscore.js:79:11)\r\n[DEBUG] : at parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.Label.js:15:4)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/base.js:11:17)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.Label.js:7:27)\r\n[DEBUG] : at Object.exports.generateNode (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:317:48)\r\n[DEBUG] : at Object.exports.generateNodeExtended (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:254:17)\r\n[DEBUG] : at /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Alloy.Abstract.ItemTemplate.js:64:15\r\n[DEBUG] : at Array.forEach (native)\r\n[DEBUG] : at Function._.each._.forEach (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/lib/alloy/underscore.js:79:11)\r\n[DEBUG] : at parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Alloy.Abstract.ItemTemplate.js:54:5)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/base.js:11:17)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Alloy.Abstract.ItemTemplate.js:10:27)\r\n[DEBUG] : at Object.exports.generateNode (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:317:48)\r\n[DEBUG] : at Object.exports.generateNodeExtended (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:254:17)\r\n[DEBUG] : at /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.ListView.js:131:17\r\n[DEBUG] : at Array.forEach (native)\r\n[DEBUG] : at Function._.each._.forEach (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/lib/alloy/underscore.js:79:11)\r\n[DEBUG] : at /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.ListView.js:122:6\r\n[DEBUG] : at Array.forEach (native)\r\n[DEBUG] : at Function._.each._.forEach (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/lib/alloy/underscore.js:79:11)\r\n[DEBUG] : at parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.ListView.js:48:4)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/base.js:11:17)\r\n[DEBUG] : at Object.exports.parse (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/parsers/Ti.UI.ListView.js:29:27)\r\n[DEBUG] : at Object.exports.generateNode (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:317:48)\r\n[DEBUG] : at /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:401:29\r\n[DEBUG] : at Array.forEach (native)\r\n[DEBUG] : at Function._.each._.forEach (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/lib/alloy/underscore.js:79:11)\r\n[DEBUG] : at Object.exports.generateNode (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:392:5)\r\n[DEBUG] : at /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/index.js:676:28\r\n[DEBUG] : at Array.forEach (native)\r\n[DEBUG] : at Function._.each._.forEach (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/lib/alloy/underscore.js:79:11)\r\n[DEBUG] : at parseAlloyComponent (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/index.js:665:5)\r\n[DEBUG] : at /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/index.js:289:6\r\n[DEBUG] : at Array.forEach (native)\r\n[DEBUG] : at Function._.each._.forEach (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/lib/alloy/underscore.js:79:11)\r\n[DEBUG] : at /Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/index.js:278:6\r\n[DEBUG] : at Array.forEach (native)\r\n[DEBUG] : at Function._.each._.forEach (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/lib/alloy/underscore.js:79:11)\r\n[DEBUG] : at module.exports (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/commands/compile/index.js:274:4)\r\n[DEBUG] : at Object. (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/Alloy/alloy.js:113:46)\r\n[DEBUG] : at Module._compile (module.js:456:26)\r\n[DEBUG] : at Object.Module._extensions..js (module.js:474:10)\r\n[DEBUG] : at Module.load (module.js:356:32)\r\n[DEBUG] : at Function.Module._load (module.js:312:12)\r\n[DEBUG] : at Module.require (module.js:364:17)\r\n[DEBUG] : at require (module.js:380:17)\r\n[DEBUG] : at Object. (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/node_modules/alloy/bin/\r\n[DEBUG] : alloy:3:1)\r\n[DEBUG] : at Module._compile (module.js:456:26)\r\n[DEBUG] : at Object.Module._extensions..js (module.js:474:10)\r\n[DEBUG] : at Module.load (module.js:356:32)\r\n[DEBUG] : at Function.Module._load (module.js:312:12)\r\n[DEBUG] : at Function.Module.runMain (module.js:497:10)\r\n[DEBUG] : at startup (node.js:119:16)\r\n[DEBUG] : at node.js:935:3\r\n[ERROR] : Alloy compiler failed\r\nTRACE | titanium exited with exit code 1\r\nERROR | Error: ti run exited with error code 1\r\n at ChildProcess. (/Users/christinevi/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/plugins/run.js:89:66)\r\n at ChildProcess.emit (events.js:117:20)\r\n at Process.ChildProcess._handle.onexit (child_process.js:820:12)\r\n", "attachment": [], "flagged": false, "summary": "AttributedString causes error when used inside ListView template", "creator": { "name": "christi", "key": "christi", "displayName": "Christi", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "christi", "key": "christi", "displayName": "Christi", "active": true, "timeZone": "America/New_York" }, "environment": "Appcelerator Studio, build: 4.3.1.201509302304\r\nTitanium SDK 5.0.1.GA\r\niOS Simulator 8.4\r\nxCode 6.4\r\nMac OSX 10.10.5 (14F27)", "comment": { "comments": [ { "id": "366701", "author": { "name": "christi", "key": "christi", "displayName": "Christi", "active": true, "timeZone": "America/New_York" }, "body": "Actually I think this can be closed. I revisited and was able to make it work. Sample:\r\n\r\n{{\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t}}\r\n\r\nThen later when creating the row, the old way (without attributed string):\r\n\r\n{{\r\nnameLabel: _.extend({\r\n text: \"asdf\"\r\n});\r\n}}\r\n\r\nNew way with attributed string:\r\n\r\n{{\r\n var attr = Ti.UI.createAttributedString({\r\n text: event.name,\r\n attributes: [\r\n {\r\n type: Titanium.UI.ATTRIBUTE_BACKGROUND_COLOR,\r\n value: \"red\",\r\n range: [0, event.name.length]\r\n }\r\n ]\r\n });\r\n \r\nnameLabel: _.extend({\r\n attributedString: attr\r\n })\r\n}}\r\n\r\nI'm not sure how to close the bug (or I cannot). Sorry about that!", "updateAuthor": { "name": "christi", "key": "christi", "displayName": "Christi", "active": true, "timeZone": "America/New_York" }, "created": "2015-10-13T20:53:44.000+0000", "updated": "2015-10-13T20:53:44.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }