[ALOY-127] 'alloy generate view' should generate a View not Window
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2012-08-02T09:17:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2012 Sprint 15, Release 3.0.0 |
Components | n/a |
Labels | n/a |
Reporter | Tim Poulsen |
Assignee | Unknown |
Created | 2012-07-25T08:46:40.000+0000 |
Updated | 2018-03-07T22:25:39.000+0000 |
Description
Most apps have one window, or just a couple, but have many views. It would make more sense to me that 'alloy generate view view_name' would generate a View not a Window.
Perhaps we should have something a little more robust than this to allow more power and flexibility. We could have an option or argument to the CLI that lets you specify the type of element you'd like in the generated view. Or we could even have templates for the generated views. Couple ideas:
Where VIEW_TYPE would be an optional argument that gives the top-level view type (i.e., View, Window, TabGroup, etc...)
Where TEMPLATE could be a view template we would define somewhere in Alloy. I think we probably need to define what are the useful "templates" for views before making any changes.
I like the template choice. If a View is used though don't we need to wrap in window so we can use it add() and open().
I don't understand what you mean in your last sentence. The template would dictate which elements are used. Where do add() and open() come into play?
Tony, both VIEW_TYPE and TEMPLATE would be fantastic. I still think the default (if you omit VIEW_TYPE) should be View not Window! :)
If I create a View and then put a Button in it in index.xml and in the controller index.js I do $.index.open(); that will work? If so forget what what I wrote above.
Russ, this is exactly why I brought up the concept of removing the 'view' generator and providing only the "component" one. That way your "TEMPLATE" would consist not only of the view, but also the style and controller, allowing you construct all 3 files in concert.
now generates View by default. Initial issue is fixed. Created new issue ALOY-158 to discuss generating based on templates.