Titanium JIRA Archive
Alloy (ALOY)

[ALOY-127] 'alloy generate view' should generate a View not Window

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusResolved
ResolutionFixed
Resolution Date2012-08-02T09:17:33.000+0000
Affected Version/sn/a
Fix Version/s2012 Sprint 15, Release 3.0.0
Componentsn/a
Labelsn/a
ReporterTim Poulsen
AssigneeUnknown
Created2012-07-25T08:46:40.000+0000
Updated2018-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.

Comments

  1. 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. Couple ideas:
    alloy generate view VIEW_NAME [VIEW_TYPE]
    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 [-v TEMPLATE]
    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.
  2. 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().
  3. 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?
  4. 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! :)
  5. 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.
  6. 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.
  7. 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.

JSON Source