{ "id": "105925", "key": "ALOY-413", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15404", "description": "Alloy 2.0.0", "name": "Alloy 2.0.0", "archived": false, "released": false } ], "resolution": null, "resolutiondate": null, "created": "2012-12-04T13:59:19.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-07T22:25:33.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": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "Let's allow developers to explicitly define which controller they would like to associate with a given view. Currently, a controller is associated with a view simply by having the same name. But there are cases where you'll want multiple views to be able to use the same controller code. Loosely coupling views and controllers will allow for less LOC and more manageable code. For example, the [tableview_binding test app|https://github.com/appcelerator/alloy/tree/master/test/apps/models/tableview_binding] could make very good use of this ability.\r\n\r\nHere's a simple proposed syntax for doing so:\r\n\r\n{code:xml}\r\n\r\n \r\n\r\n{code}\r\n\r\nAlloy will handle the association under the hood, the developer will simply need to specify the name of the controller to use.", "attachment": [], "flagged": false, "summary": "Allow views to explicitly define the associated controller", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "229813", "author": { "name": "kwhinnery", "key": "kwhinnery", "displayName": "Kevin Whinnery", "active": true, "timeZone": "America/Chicago" }, "body": "Suggestion: make the controller attribute accept a comma-separated list of controllers, which would be inlined in the generated \"component\" in the same way the single controller is today.", "updateAuthor": { "name": "kwhinnery", "key": "kwhinnery", "displayName": "Kevin Whinnery", "active": true, "timeZone": "America/Chicago" }, "created": "2012-12-04T14:55:13.000+0000", "updated": "2012-12-04T14:55:13.000+0000" }, { "id": "229814", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I was planning on making it space-separated. :)", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-04T14:59:05.000+0000", "updated": "2012-12-04T14:59:05.000+0000" }, { "id": "229831", "author": { "name": "kwhinnery", "key": "kwhinnery", "displayName": "Kevin Whinnery", "active": true, "timeZone": "America/Chicago" }, "body": "commas or I boycott the framework.", "updateAuthor": { "name": "kwhinnery", "key": "kwhinnery", "displayName": "Kevin Whinnery", "active": true, "timeZone": "America/Chicago" }, "created": "2012-12-04T17:16:46.000+0000", "updated": "2012-12-04T17:16:46.000+0000" }, { "id": "302160", "author": { "name": "ronaldtreur", "key": "ronaldtreur", "displayName": "Ronald Treur", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "This issue kinda turns the way classic MVC-frameworks operate on its head. In this classic approach a View should be useable by any Controller and it is up to the Controller to make that decision. Views are simply 'dumbed down' templates, waiting for a Controller to fill them with meaning. Now I know that Alloy already empowered the Views for a bit, but personally I would (for the sake of consistency with other MVC-frameworks) still suggest to stick to the that approach. So in fact I would suggest the complete opposite:\r\n\r\nGive Controllers the freedom to pick the View(s) they want. \r\n\r\nThis still solves the case mentioned in this ticket's description, where you wanted a single Controller to be able to use multiple Views (see what I did there? ;-))", "updateAuthor": { "name": "ronaldtreur", "key": "ronaldtreur", "displayName": "Ronald Treur", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-04-23T10:33:53.000+0000", "updated": "2014-04-23T10:33:53.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }