{ "id": "116937", "key": "ALOY-733", "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": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2014-01-17T18:25:31.000+0000", "created": "2013-07-08T11:16:57.000+0000", "priority": null, "labels": [ "alloy", "inheritance" ], "versions": [], "issuelinks": [], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2014-01-17T18:25:31.000+0000", "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" } }, "components": [], "description": "Suppose there is a view - \"base.xml\" and its associated controller - \"base.js\". Now, I wish to inherit this controller in order to create a new view via this new controller say, \"descendant.js\". \r\n From my understanding of Alloy inheritance, if i use exports.baseController = \"base\" as the 1st line in \"descendant.js\", I should be able to access all exported functions of \"base.js\". However, I've found that this is in fact not the case. \r\n Suppose there is a button in the view \"base.xml\" and on clicking it an event listener say, speak(), in \"base.js\" is called. I export it by assigning it to exports object using \"exports.speak = speak;\". Now in \"descendant.js\" when i override this speak function and try to call it in order to perform different actions for the same event of clicking the button, the same speak function of the \"base.js\" is called and not the overridden speak() of \"descendant.js\". \r\n Please address this issue. If this issue is solved, it would help me use a single view say \"base.xml\" for a host of views whose controllers all inherit the \"base.js\" controller and respond to the same events in a polymorphic way. This would make using alloy MVC hugely beneficial.", "attachment": [], "flagged": false, "summary": "Alloy controller inheritance", "creator": { "name": "p.clement.paul@accenture.com", "key": "p.clement.paul@accenture.com", "displayName": "Prashanth Clement Paul", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK - 3.1.1.GA", "comment": { "comments": [ { "id": "288636", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Please provide a test case (minimal app) that demonstrates what you're trying to do. Also describe clearly what behavior you expect compared to what happens currently. The existing problem description is hard to follow which makes it hard to see where the existing inheritance model falls short of your expectations. ", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-01-17T18:25:31.000+0000", "updated": "2014-01-17T18:25:31.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }