{ "id": "173450", "key": "ALOY-1688", "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": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2019-06-19T12:14:09.000+0000", "created": "2019-04-09T13:12:34.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "updated": "2019-06-19T12:14:09.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": [], "description": "Using these conditions:\r\n* SDK 8.0.0.GA\r\n* Alloy\r\n* NavigationWindow (cross-platform newly implemented in SDK 8.x)\r\n* Android\r\n* ActionBar\r\n* Subtitle (of ActionBar)\r\n\r\nWith all of those set, when I try to set the subtitle I get the following error:\r\n{color:red}[WARN] ActionBarProxy: (main) [201,14240] ActionBar is not enabled\r\n{color}\r\nand no subtitle is set.\r\n\r\n* It doesnt matter whether I try to set the subtitle in the .tss file or whether I set in the onOpen Method. In either case setting the subtitle fails with the above error.\r\n* Joshua Quick said \"subtitle\" works for him if he uses Classic Ti (not Alloy).\r\n* If I simply, only, remove the parent NavigationWindow, then the \"subtitle\" works for me in Alloy.\r\n\r\n*+From index.js, I open my Alloy Window with this code:+*\r\n{code:javascript}\r\nvar settingsView = Alloy.createController('settings').getView();\r\nsettingsView.open();\r\n{code}\r\n\r\nAnd here is my Alloy code for my settings view:\r\n*+settings.xml+*\r\n{code:javascript}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\n*+settings.js+*\r\n{code:javascript}\r\nfunction onWindowOpen(){\r\n var actionBar = $.settings.activity.actionBar;\r\n actionBar.subtitle = \"Subtitle Here\";\r\n}\r\n{code}\r\n\r\n\r\nAnd I even thought it might be an issue with trying to update in the onOpen method so I removed the section in my settings.js and moved the subtitle piece to my settings.tss file like this\r\n{code:javascript}\r\n\"ActionBar\": {\r\n\tsubtitle: \"subtitle text here\"\r\n}\r\n{code}\r\nand I still got the same error.\r\n\r\n\r\nAnd then, again, to reiterate....if I simply remove from my .xml then everything works fine.", "attachment": [], "flagged": false, "summary": "Android: ActionBar Subtitle not working when using both Alloy & NavigationWindow", "creator": { "name": "amwinsauto", "key": "amwinsauto", "displayName": "Adam Armstrong", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "amwinsauto", "key": "amwinsauto", "displayName": "Adam Armstrong", "active": true, "timeZone": "America/Chicago" }, "environment": "Titanium SDK 8.0.0.GA\r\nAndroid 9", "comment": { "comments": [ { "id": "447550", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This might be an Alloy issue. After doing a build, we need to double check the JS code that Alloy generates under the project's \"Resources\" directory to see what's going wrong.\r\n\r\nBecause the below works fine in a Classic app. So, we know it's possible to set the ActionBar's subtitle when launched via NavigationWindow.\r\n{code:javascript}\r\nvar parentWindow = Ti.UI.createWindow({\r\n\ttitle: \"My Title\",\r\n\tbarColor: \"blue\",\r\n});\r\nparentWindow.add(Ti.UI.createLabel({ text: \"Hello World!\" }));\r\nparentWindow.addEventListener(\"open\", function() {\r\n\tvar actionBar = parentWindow.activity.actionBar;\r\n\tif (actionBar) {\r\n\t\tactionBar.subtitle = \"My Subtitle\";\r\n\t}\r\n});\r\nvar navigationWindow = Ti.UI.createNavigationWindow({\r\n\twindow: parentWindow,\r\n});\r\nnavigationWindow.open();\r\n{code}\r\n\r\nThanks for reporting the issue [~amwinsauto].", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-09T17:30:07.000+0000", "updated": "2019-04-09T17:30:07.000+0000" }, { "id": "448470", "author": { "name": "amwinsauto", "key": "amwinsauto", "displayName": "Adam Armstrong", "active": true, "timeZone": "America/Chicago" }, "body": "Its been well over a month with no update....has anyone @ AppC at least been able to identify where/what this issue is?", "updateAuthor": { "name": "amwinsauto", "key": "amwinsauto", "displayName": "Adam Armstrong", "active": true, "timeZone": "America/Chicago" }, "created": "2019-05-17T12:13:53.000+0000", "updated": "2019-05-17T12:13:53.000+0000" }, { "id": "448530", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Hey [~amwinsauto], \r\n\r\nLooking at the compiled sourcecode, this looks to be because as there's no id set on the NavigationWindow alloy gives it a default id, which is the filename {{settings}}. Which classes with your Window id. So then when the onWindowOpen function is called {{$.settings}} references the NavigationWindow and not the Window instance. You can fix this by either changing the id for the Windows, or creating a throwaway id for the NavigationWindow. \r\n\r\nBased off the compile code and my observations locally, when alloy is processing the view there _should_ be a warning in the log output {{\\[WARN\\] at line 3 is using this view's default ID \"settings\". Only a top-level element in a view should use the default ID}}, which is super easy to miss", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-05-20T17:48:47.000+0000", "updated": "2019-05-20T17:48:47.000+0000" }, { "id": "448818", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~amwinsauto],\r\n\r\nI'm just following-up on this since the ticket is still open.\r\n\r\nBased on [~eharris]'s findings, the issue is that there is variable name collision. Alloy automatically creates a variable based on the XML file you have. In this case, a \"settings\" variable for your \"settings.xml\" file which references {{}}. This variable name is colliding with your {{}} variable \"settings\".\r\n\r\nThe solution is to change your {{}} \"id\" to a different name, such as \"settingsWindow\", and fetch the activity from that variable. This will solve the issue.\r\n\r\nSorry about the delay. I hope this helps.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-04T18:19:18.000+0000", "updated": "2019-06-04T18:19:18.000+0000" }, { "id": "449190", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Closing as not our bug", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-06-19T12:14:09.000+0000", "updated": "2019-06-19T12:14:09.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }