{ "id": "145396", "key": "ALOY-1256", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "21028", "description": "", "name": "CLI Release 8.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-08-12T13:10:59.000+0000", "created": "2015-03-04T12:50:59.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "griffin-app", "merge-to-next", "require", "view", "widgets", "xml" ], "versions": [ { "id": "16595", "name": "Alloy 1.5.1", "archived": false, "released": true, "releaseDate": "2014-10-01" }, { "id": "16692", "name": "Alloy 1.7.0", "archived": false, "released": true, "releaseDate": "2015-07-22" } ], "issuelinks": [ { "id": "59292", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "175918", "key": "ALOY-1748", "fields": { "summary": "Widget - Regression - weird behavior - some exporting functions are not working with CLI 8.1.1", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "58966", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "175805", "key": "ALOY-1743", "fields": { "summary": "Runtime error when Widget contains another Widget at the top level", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "58687", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "175488", "key": "ALOY-1738", "fields": { "summary": "CLI 8.1.0: crash when to listening backbone.events on required controller in ScrollableView", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "updated": "2021-06-16T14:13:54.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": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "When a controller-view has a widget or require as a root element, the compiled code will use the required controller as the view, as seen in the following example:\r\n\r\n*index.xml*\r\n{code:xml}\r\n\r\n \r\n\r\n{code}\r\n\r\n*widget.xml*\r\n{code:xml}\r\n\r\n \r\n \r\n \r\n\r\n{code}\r\n\r\n*index.js (compiled)*\r\n{code:js}\r\n//..\r\n $.__views.index = Alloy.createWidget(\"foo\", \"widget\", {\r\n id: \"index\"\r\n });\r\n $.__views.index && $.addTopLevelView($.__views.index);\r\n//..\r\n{code}\r\n\r\n*console*\r\n{code}\r\n[ERROR] TypeError: undefined is not a function (evaluating '$.index.open()')\r\n[ERROR] File: app.js\r\n[ERROR] Line: 33\r\n[ERROR] SourceId: \r\n[ERROR] Backtrace:\r\n[ERROR] undefined\r\n{code}\r\n\r\n*index.js (expected)*\r\n{code:js}\r\n//..\r\n $.__views.index = Alloy.createWidget(\"foo\", \"widget\", {\r\n id: \"index\"\r\n });\r\n $.__views.index && $.addTopLevelView($.__views.index.getView());\r\n // OR: $.__views.index && $.addTopLevelView($.__views.index.getViewEx({recurse:true}));\r\n//..\r\n{code}\r\n\r\nFound via this GitHub ticket, which includes a link to a full example:\r\nhttps://github.com/FokkeZB/nl.fokkezb.pullToRefresh/issues/39", "attachment": [], "flagged": false, "summary": "Widget/Require as top-level element uses controller as view", "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 1.7.0-dev\r\nSDK 3.5.1.RC", "comment": { "comments": [ { "id": "345043", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "It might seem like it doesn't make sense to have a widget/require as top-level element, but as https://github.com/miko91/test-widget/blob/master/app/views/news.xml shows with the recent support for children tags it can be very useful.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-03-04T12:52:41.000+0000", "updated": "2015-03-04T12:52:41.000+0000" }, { "id": "352073", "author": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "body": "There is a temporary fix for this situation? I have the same issue.\r\n\r\n```\r\n\r\n\r\n\r\n.....\r\n\r\n\r\n\r\nstill fails with the view.`\r\n```\r\n\r\nP.S Just on Android", "updateAuthor": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2015-05-08T21:28:14.000+0000", "updated": "2015-05-08T21:34:29.000+0000" }, { "id": "352119", "author": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "body": "You can ignore my report above, please see what happened.\r\n\r\n [https://github.com/FokkeZB/nl.fokkezb.pullToRefresh/issues/39]", "updateAuthor": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2015-05-10T15:48:32.000+0000", "updated": "2015-05-10T15:49:03.000+0000" }, { "id": "453235", "author": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "Transferring work from ALOY-1713 as it was a duplicate", "updateAuthor": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2019-12-18T15:12:03.000+0000", "updated": "2019-12-18T15:12:03.000+0000" }, { "id": "453236", "author": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "Created PR: https://github.com/appcelerator/alloy/pull/949", "updateAuthor": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2019-12-18T15:12:39.000+0000", "updated": "2019-12-18T15:12:39.000+0000" }, { "id": "454145", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Test project https://github.com/brentonhouse/alloy-widget-test", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-02-10T12:38:32.000+0000", "updated": "2020-02-10T12:38:32.000+0000" }, { "id": "456163", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Test steps:\r\n\r\nCheck out the test project at https://github.com/brentonhouse/alloy-widget-test", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-07-20T11:03:07.000+0000", "updated": "2020-07-20T11:03:07.000+0000" }, { "id": "456435", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket, fix verified in CLI version {{8.1.0-master.10}}, tested using the test case above. ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-08-12T13:10:32.000+0000", "updated": "2020-08-12T13:10:32.000+0000" }, { "id": "458688", "author": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "body": "What if someone need to refer the widget controller itself to call certain controller methods? Previously with this code\r\n\r\n{code:xml}\r\n\r\n{code}\r\n\r\n$.drawer would refer to the Widget controller object but now it only refer to the top level view from the widget. No way to access controller object from xml except creating the widget in js code.", "updateAuthor": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "created": "2021-05-18T12:07:00.000+0000", "updated": "2021-05-18T12:07:00.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }