{ "id": "97567", "key": "ALOY-111", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2012-08-10T11:08:23.000+0000", "created": "2012-07-18T09:24:46.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "19752", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "98884", "key": "ALOY-165", "fields": { "summary": "Advanced sample that shows inheritance and lifecycle functions", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-02-04T00:34:52.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": null, "attachment": [], "flagged": false, "summary": "Create simple sample that shows application life cycle ", "creator": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "208303", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Do you mean lifecycle events? Right now I only created 'onCreate' for the generated components, which is attached via markup like this:\r\n\r\nh4. index.xml\r\n{code:xml}\r\n\r\n \r\n\r\n{code}\r\n\r\nh4. index.js\r\n{code:javascript}\r\nfunction doCreate() {\r\n // insert code to be executed before generated view and controller code\r\n}\r\n{code}", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T09:33:26.000+0000", "updated": "2012-07-18T09:33:26.000+0000" }, { "id": "208306", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yup. Looks good but I think we should also have a matching destroy. Are there other App life cycle events we could make available through markup? ", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T09:41:43.000+0000", "updated": "2012-07-18T09:41:43.000+0000" }, { "id": "208313", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Well, we can have a {{destroy}} life cycle event, but it would need to be fired manually so I don't know how much sense it makes. I think it might confuse developers if we allow them to specify an {{onDestroy}} function, but the event never fires unless they fire/trigger it manually. On the other hand, having a standardized location even for manually triggered {{destroy}} operations would be good. I'm not sure how we can be clear that an {{onCreate}} happens automatically, but an {{onDestroy}} needs to be done manually.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T09:49:55.000+0000", "updated": "2012-07-18T09:49:55.000+0000" }, { "id": "208351", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can we generate the code to fire an app destroy event so the developer does not manually have to do it?", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T11:32:43.000+0000", "updated": "2012-07-18T11:32:43.000+0000" }, { "id": "208353", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "No, that's the nature of Javascript and why it's been done manually to this point.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T11:36:14.000+0000", "updated": "2012-07-18T11:36:14.000+0000" }, { "id": "208364", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Not sure if this would work but found it online:\r\n\r\nTi.App.addEventListener('pause',function(e)\r\n{\r\n // do code here\r\n});\r\n\r\n\r\nhttp://developer.appcelerator.com/question/139716/is-there-any-way-i-can-respond-to-the-application-close-event", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T11:52:18.000+0000", "updated": "2012-07-18T11:52:18.000+0000" }, { "id": "208367", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I see the pause is an iOS only event so not as helpful", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T11:56:07.000+0000", "updated": "2012-07-18T11:56:07.000+0000" }, { "id": "208368", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The app in that case can just as easily resume, and you would have destroyed all of its components. Obviously not the desired effect. This makes the case for {{onPause}} and {{onResume}} events, but we don't have an object to apply them to, as they would apply to the application, not a specific component. It would probably make more sense right now to just handle them as they are now.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T11:56:23.000+0000", "updated": "2012-07-18T11:56:23.000+0000" }, { "id": "213794", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "duplicate of ALOY-165", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-10T11:08:23.000+0000", "updated": "2012-08-10T11:08:23.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }