{ "id": "138359", "key": "ALOY-1175", "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": "16596", "name": "Alloy 1.6.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-10-27T14:34:46.000+0000", "created": "2014-10-21T21:09:04.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "16596", "name": "Alloy 1.6.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "issuelinks": [ { "id": "42308", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "132785", "key": "ALOY-1098", "fields": { "summary": "Support actionView property of MenuItem in XML markup", "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": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "48196", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "149129", "key": "ALOY-1283", "fields": { "summary": "ActionView views with an ID cannot be found under $ because they are created after merge", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2015-06-25T10:16:23.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": "DESCRIPTION:\r\nCannot call methods or access properties using the `id` attribute of MenuItems created in XML markup.\r\nRelated feature ticket: ALOY-1098\r\n\r\nREPRODUCTION:\r\nRun the Alloy application below. Hit the Expand or Collapse action items or try to expand the action view from the overflow menu.\r\n\r\nRESULTS:\r\nTrying to call a method or accessing a property results in 'Cannot read property of undefined` or `Cannot call method X of undefined`.\r\n\r\n{noformat}\r\n[ERROR] : TiExceptionHandler: (main) [3824,3824] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [0,3824] - In alloy/controllers/index.js:70,28\r\n[ERROR] : TiExceptionHandler: (main) [1,3825] - Message: Uncaught TypeError: Cannot read property 'actionViewExpanded' of undefined\r\n[ERROR] : TiExceptionHandler: (main) [0,3825] - Source: Ti.API.info($.item3.actionViewExpanded);\r\n[ERROR] : V8Exception: Exception occurred at alloy/controllers/index.js:70: Uncaught TypeError: Cannot read property 'actionViewExpanded' of undefined\r\n{noformat}\r\n\r\n\r\n\r\n\r\n\r\n`index.xml`\r\n{code}\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \t\r\n \t\r\n \t\r\n \r\n \r\n \r\n \r\n \r\n\r\n{code}\r\n\r\n`index.js`\r\n{code}\r\n$.win.open();\r\n\r\nfunction expand (e) {\r\n\t$.item3.expandActionView();\r\n};\r\n\r\nfunction collapse(e) {\r\n\t$.item3.collapseActionView();\r\n}\r\n\r\nfunction report(e) {\r\n\tTi.API.info(e.type);\r\n\tTi.API.info($.item3.actionViewExpanded);\r\n}\r\n{code}\r\n\r\nClassic Examples:\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nvar item1 = item2 = item3 = null;\r\nvar actionView = Ti.UI.createView({layout: 'horizontal'});\r\nactionView.add(Ti.UI.createButton({title: 'Search', left: 0}));\r\nactionView.add(Ti.UI.createTextField({hintText: 'Type Something', right: '0'}));\r\nwin.addEventListener(\"open\", function() {\r\n\r\n win.activity.onCreateOptionsMenu = function(e) {\r\n var item, menu;\r\n menu = e.menu;\r\n menu.clear();\r\n item1 = menu.add({\r\n title : \"Collapse\",\r\n showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS\r\n });\r\n\t\titem1.addEventListener('click', function (e) {\r\n\t\t\titem3.collapseActionView();\r\n\t\t});\r\n item2 = menu.add({\r\n title : \"Expand\",\r\n showAsAction : Ti.Android.SHOW_AS_ACTION_ALWAYS\r\n });\r\n item2.addEventListener('click', function (e) {\r\n\t\t\titem3.expandActionView();\r\n\t\t});\r\n item3 = menu.add({\r\n \ttitle : 'Alt Text',\r\n \tshowAsAction : Titanium.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW,\r\n \tactionView: actionView\r\n });\r\n item3.addEventListener('collapse', function(e) {\r\n \tTi.API.info(item3.actionViewExpanded);\r\n });\r\n item3.addEventListener('expand', function(e) {\r\n \tTi.API.info(item3.actionViewExpanded);\r\n });\r\n };\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "Cannot call methods or access properties on MenuItems declared in markup", "creator": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Alloy from master Mon Oct 20 14:01:55/b109a668b5b22fb8dd0a61978f84fcce40a3287f\r\nTitanium SDK 3.4.0.GA\r\nAppcelerator Studio 3.4.0.GA\r\nMac OS X 10.9.4\r\nAndroid 4.2.2/API level 19\r\nGenymotion Google Nexus 7 - Android 4.2.2\r\n", "closedSprints": [ { "id": 248, "state": "closed", "name": "2014 Sprint 22 Alloy", "startDate": "2014-10-27T13:32:25.636Z", "endDate": "2014-11-10T13:32:00.000Z", "completeDate": "2014-11-10T15:54:03.714Z", "originBoardId": 124 } ], "comment": { "comments": [ { "id": "328902", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-21T21:47:31.000+0000", "updated": "2014-10-21T21:47:31.000+0000" }, { "id": "329172", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR https://github.com/appcelerator/alloy/pull/597\r\n\r\nFunctional test:\r\n\r\nYou can use Ben's app above or the one included with the PR (test/apps/testing/ALOY\\-1175). Run on Android. Click Expand, then Back (or title icon). Click Collapse. Expand the menu and click Item 3. You should not get errors and the action view should be expanded/collapsed as expected.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-23T15:24:34.000+0000", "updated": "2014-10-23T15:24:34.000+0000" }, { "id": "329373", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Because this & ALOY-1098 depend upon each other, I've combined the fix into a single PR for 1_6_X\r\n\r\nhttps://github.com/appcelerator/alloy/pull/606\r\n\r\nTest this using the ALOY\\-1175 test app included in the PR", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-10-24T18:18:19.000+0000", "updated": "2014-10-24T18:18:19.000+0000" }, { "id": "329514", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR merged.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2014-10-27T14:34:46.000+0000", "updated": "2014-10-27T14:34:46.000+0000" }, { "id": "347341", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed using:\r\n\r\nTitanium SDK 4.0.0.v20150323131014\r\nStudio 4.0.0.201503231407\r\nAppc NPM: 0.3.34\r\nAppc CLI 0.2.187\r\nAlloy 1.6.0-alpha\r\n\r\nOn: Nexus 6, Android 5.0.1\r\n\r\nAble to call methods and access properties on items in view xml. No errors shown.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-03-25T21:46:43.000+0000", "updated": "2015-03-25T21:46:43.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }