{ "id": "107232", "key": "ALOY-504", "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": null, "resolutiondate": null, "created": "2012-12-31T20:08:13.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "alloy", "bind", "bindings", "controller", "data", "model", "views" ], "versions": [], "issuelinks": [], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2018-08-20T23:06:48.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "13605", "name": "Models" }, { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "This issue is related to the following topic on Google Groups:\r\nhttps://groups.google.com/forum/?fromgroups=#!topic/appc-ti-alloy/7TKs1YiLrNk\r\n\r\nIt asks for:\r\n\r\n# Exposing the Alloy-generated data-binding function.\r\n# Making the function compatible to consume any iterable array or object.\r\n# Having of the option to not automatically add this function as an event listener to model or collection, so you can decide when to call it, using whatever data you like.\r\n\r\nThese small changes allow for a more flexible use of the data-binding in Alloy, while maintaining the ready-for-use approach available right now.", "attachment": [], "flagged": false, "summary": "Remove event listeners on dataFunction", "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": "248745", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "The 2nd point of this issue can be dropped. The first and last are already in Alloy 1.1, now we have the {{dataFunction}} attribute. The 2nd point now has it's own issue with more details and examples: TC-2188.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-04-23T09:15:55.000+0000", "updated": "2013-04-23T09:15:55.000+0000" }, { "id": "248763", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "ACtually, the 3rd point is not resolved. Although you can expose the binding function with an explicit name, it is still always fired on your behalf, you just have the ability to do it manually as well. I'm pondering now if defining the name should imply that you want to be in full control of when binding fires, or if a secondary attribute should indicate that. I guess my concern is that if you are manually defining the name of the function and when it will be called, why bother doing the binding in markup at all? Why not just do it all in code?", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-23T15:50:42.000+0000", "updated": "2013-04-23T15:50:42.000+0000" }, { "id": "248793", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I would say that the very reason for wanting to name the data-binding method is that you want to call it yourself. So yes, I suggest to drop the listeners if {{dataFunction}} was used.\r\n\r\nWhy bother you ask? Well, because you want your views to show all there is to it and not have some UI hidden away in the controller.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-04-23T19:16:54.000+0000", "updated": "2013-04-23T19:16:54.000+0000" }, { "id": "258109", "author": { "name": "jicks83", "key": "jicks83", "displayName": "Jick Steen", "active": true, "timeZone": "Europe/Berlin" }, "body": "+1 for dropping the listeners if dataFunction is used.", "updateAuthor": { "name": "jicks83", "key": "jicks83", "displayName": "Jick Steen", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-16T18:04:05.000+0000", "updated": "2013-06-16T18:04:05.000+0000" }, { "id": "304788", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "I'm trying to plan out time for this ticket. Am I correct that in the end, all that's being asked for is removing the listeners on dataFunction? Since that could potentially break existing apps, would you see any issues with creating a new function that didn't have listeners and keeping them on dataFunction()?", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-05-14T15:55:10.000+0000", "updated": "2014-05-14T15:55:10.000+0000" }, { "id": "304941", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I gave a detailed description in a new ticket: ALOY-639\r\n\r\nI think we should have tackled both issues together, as now indeed we might break apps unless we introduce a new attribute and I'd hate that. Actually I doubt how many people actually use {{dataFunction}}. I don't, because I don't see much use in it without the additional functionality described in ALOY-639, since for what it does now you could as well just trigger a {{fetch}} or other event on the collection.\r\n\r\nSo, if it was up to me... just change the behavior of {{dataFunction}} to meet ALOY-639 and add a breaking note to the release notes. It'll be just a few apps.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-05-15T06:53:34.000+0000", "updated": "2014-05-15T06:53:34.000+0000" }, { "id": "355115", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "I know this ticket is quite old, but point number 2 in the initial request would be a huge bonus. It's really awkward having to work with Alloy Models all the time for dataCollection to work. Sometimes that's just not possible with a certain APIs that you get (we use the sqlrest adaptor with Alloy Models), which means you then have to resort to some nasty workarounds throughout your project. Being able to pass in a simple array would be amazing and a huge time saver.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2015-06-15T12:02:17.000+0000", "updated": "2015-06-15T12:02:17.000+0000" }, { "id": "355139", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~jyounus] I agree it would be a great improvement, which is now requested under ALOY-639. If you have time to give it a go, the required changes should be in https://github.com/appcelerator/alloy/blob/master/Alloy/commands/compile/compilerUtils.js#L914.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-06-15T17:25:41.000+0000", "updated": "2015-06-15T17:25:41.000+0000" }, { "id": "355193", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Thanks for your reply Fokke! \r\n\r\nThis look promising. I won't have time to checkout the current progress on Alloy, I'll have to wait until those changes are inside the latest stable Alloy update. But really looking forward to stop using these workarounds for binding data! ", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2015-06-16T08:53:18.000+0000", "updated": "2015-06-16T08:53:18.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }