Titanium JIRA Archive
Alloy (ALOY)

[ALOY-695] Create controller-specific version of Alloy.UI.create() that doesn't require controller name

GitHub Issuen/a
TypeSub-task
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-08T16:05:17.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, 2013 Sprint 12
ComponentsRuntime, Styling
Labelsqe-testadded
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2013-06-07T21:17:55.000+0000
Updated2013-08-23T23:51:08.000+0000

Description

Currently UI components can be created with dynamic styling by calling Alloy.UI.create(). The signature of this function takes the following 3 parameters (in order): * A string containing the name of the current controller * A string containing the API name of the component to create * An options object containing style information and properties to add to the created component To make things easier, there should be a controller-specific version that doesn't require the first parameter. SO instead of doing this:
var proxy = Alloy.UI.create(
    'index',
    'Label',
    { id: 'someId', text: 'some text' }
);
you would just be able to do this in the index controller:
var proxy = $.UI.create(
    'Label',
    { id: 'someId', text: 'some text' }
);

Comments

  1. Tony Lukasavage 2013-06-08

    PR: https://github.com/appcelerator/alloy/pull/150 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-695 Functionally testing should involve successfully running the app on all supported platforms. While running, repeatedly click the main window. The result should be that a dynamically styled label should appear on the screen after each click. The style of the label should be impacted by the current array of styles applied to it, found in the *classes* array variable in the *app/controllers/index.js* controller. After generating about 10 labels, click on the first label that says "click me". This will open a new window from a new controller (foo/bar). While this controller runs nearly identical code, it has different definitions for the style classes in use. You should notice that it also generates labels as you click the window, and these styles will differ slightly from those on the prior window (as per the style defined in "app/styles/foo/bar.tss")

JSON Source