{ "id": "125595", "key": "ALOY-944", "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": "2014-01-29T19:22:19.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "alloy", "basecontroller", "controller", "inheritance", "view" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-07T22:26:08.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": [], "description": "When a controller uses the {{baseController}} property, it will basically result in the compiled controller extending the specified controller instead of the standard [BaseController.js|https://github.com/appcelerator/alloy/blob/master/Alloy/lib/alloy/controllers/BaseController.js]. The extending controller will inherit the extended controller's UI and non-private controller code.\r\n\r\nThis is nice for cases like the [inheritance example|https://github.com/appcelerator/alloy/blob/master/test/apps/advanced/inheritance/_generated/ios/alloy/controllers/animatedDialog.js] in the Alloy repo where only the controller-part is extended, but there is no way to do the same with the UI. This is because the top-level views of a controller are stored in a private {{roots}} variable of the extended controller. You can push new top-level views using {{addTopLevelView}}, but not remove any.\r\n\r\nI would like to have the possibility of re-setting the top-level views for the extending controller, so that I can decide what parts of the exteded controller's UI I want to re-use by adding them to the extending controller UI and then add then set that UI as the top-level.\r\n\r\nI guess it might be as simple as adding a {{setTopLevelViews}} method to the {{BaseController}} that would accept an array of views that it replace {{roots}} with?\r\n\r\nLooking forward to your thoughts.", "attachment": [], "flagged": false, "summary": "Add \"setTopLevelViews\" so controllers extending others can redefine the UI", "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": "Alloy master", "comment": { "comments": [], "maxResults": 1, "total": 1, "startAt": 0 } } }