[ALOY-127] 'alloy generate view' should generate a View not Window
|Fix Version/s||2012 Sprint 15, Release 3.0.0|
DescriptionMost 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.
- Tony Lukasavage 2012-07-27
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.
Where VIEW_TYPE would be an optional argument that gives the top-level view type (i.e., View, Window, TabGroup, etc...)
alloy generate view VIEW_NAME [VIEW_TYPE]
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.
alloy generate view VIEW_NAME [-v TEMPLATE]
- Russell McMahon 2012-07-27 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().
- Tony Lukasavage 2012-07-27 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?
- Tim Poulsen 2012-07-27 Tony, both VIEW_TYPE and TEMPLATE would be fantastic. I still think the default (if you omit VIEW_TYPE) should be View not Window! :)
- Russell McMahon 2012-07-27 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.
- Tony Lukasavage 2012-07-27 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.
- Tony Lukasavage 2012-08-02 now generates View by default. Initial issue is fixed. Created new issue ALOY-158 to discuss generating based on templates.