[ALOY-533] Better error message when defining menu on a lightweight window
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-07-19T19:03:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 15 |
Components | Runtime, XML |
Labels | qe-testadded |
Reporter | Jeff English |
Assignee | Tony Lukasavage |
Created | 2013-02-22T16:10:52.000+0000 |
Updated | 2013-07-24T00:07:04.000+0000 |
Description
If you define a lightweight window that includes the definition of a 'menu' and attempt to 'open' it, at runtime it will display an obscure error message -- "Uncaught TypeError: Cannot call method 'extend' of undefined" (see attached screen shot) It turns out that this is due to the fact that a menu can only be defined on a heavyweight window. Changing the window definition to be a heavyweight window resolves the issue. It would be helpful to have the error message indicate that you are attempting to set a menu on a lightweight window. Reproduction Steps: 1. Create a new Alloy project (use the default 'simple' template) 2. Edit the index.xml file 3. Add a menu to the window definition 4. Run as an Android application (simulator or device) You should get the attached error dialog 5. Add the 'navBarHidden=true' attribute to the 'Window' element in index.xml 6. Run as an Android application (simulator or device) The application should run fine and you should see the menu when you press the menu button.Attachments
File | Date | Size |
---|---|---|
Screen Shot 2013-02-22 at 10.03.29 AM.png | 2013-02-22T16:10:52.000+0000 | 27187 |