{ "id": "111429", "key": "ALOY-600", "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": [ { "id": "15572", "description": "2013 Sprint 16", "name": "2013 Sprint 16", "archived": true, "released": true, "releaseDate": "2013-08-12" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-08-05T19:32:39.000+0000", "created": "2013-03-19T21:15:30.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "alloy" ], "versions": [ { "id": "14634", "description": "Alloy 1.0.0", "name": "Alloy 1.0.0", "archived": false, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-08-07T18:37:22.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": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "This error happens upon loading a controller when the view references an event handler that is only present in the baseController.\r\n\r\n[ERROR] : Invalid type passed to function. expected: KrollCallback, was: NSNull in -[TiProxy addEventListener:] (TiProxy.m:797)\r\n\r\nDiscussion:\r\n\r\nhttp://developer.appcelerator.com/question/149760/how-to-use-common-event-handlers-in-basecontroller-inherited-controller#comment-163640\r\n\r\nExample project:\r\n\r\nhttps://github.com/jbeuckm/AlloyBaseControllerEventHandler\r\n", "attachment": [], "flagged": false, "summary": "Ability for baseController to handle events marked up in descendant views.", "creator": { "name": "jbeuckm", "key": "jbeuckm", "displayName": "Joe Beuckman", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "alloy 1.1.0 / iOS simulator", "closedSprints": [ { "id": 15, "state": "closed", "name": "2013 Sprint 16", "startDate": "2013-07-30T23:54:11.929Z", "endDate": "2013-08-12T23:54:11.929Z", "completeDate": "2013-09-26T16:01:48.904Z" } ], "comment": { "comments": [ { "id": "264965", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Alloy's current inheritance is fairly limited, and there's a few things in the sample code that are not supported:\r\n\r\n* Inheritance involving any UI in the derived class\r\n* Inheritance involving markup events (a subset of the first point)\r\n\r\nThat said, deferring event handlers to an derived class can still be achieved with a bit of a deeper understanding of he inheritance possibilities that Alloy does in fact provide. Below is a test case that should show you how to do so, which comments interspersed to make clear why things are done a certain way. I'm putting it in a gist as it includes a number of files and it would be messy to include it all here:\r\n\r\nhttps://gist.github.com/tonylukasavage/6158759\r\n\r\nRunning that example will allow Alloy to make use of an inherited event handler, albeit in a slightly more complex manner.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-05T19:32:39.000+0000", "updated": "2013-08-05T19:32:39.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }