Titanium JIRA Archive
Alloy (ALOY)

[ALOY-594] Alloy: Naming a collection "collection" will fail

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-06-20T22:41:43.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, 2013 Sprint 13
ComponentsModels, Runtime
LabelsAlloy, bindings, bug, qe-testadded
ReporterDaniel Sefton
AssigneeTony Lukasavage
Created2013-03-30T14:25:12.000+0000
Updated2013-07-15T23:57:23.000+0000

Description

Hi Tony, If I call a collection: "collection", and use bindings, it will fail: This fails:
var models = datafilter(Alloy.Collections.collection);
if it was:
var models = datafilter(Alloy.Collections["collection"]);
it would not fail.

Attachments

FileDateSize
Screen Shot 2013-06-20 at 6.40.41 PM.png2013-06-20T22:42:01.000+000042968

Comments

  1. Tony Lukasavage 2013-04-02

    Can you explain what "datafilter" is?
  2. Mads Moller 2013-04-02

    Hi Tony, Its your generated code: like this: var __alloyId27 = function(e) { var models = datafilter($.tipcollection), len = models.length, rows = []; the alloy xml is: ...
  3. Mads Moller 2013-04-03

    I was not clear. The above code works, because I use $.tipcollection. Its a local collection. The bug I reported was if I called my collection "collection" like this: Alloy.createCollection("collection");
  4. Tony Lukasavage 2013-06-20

    This was resolved by an earlier commit. I created a test app to confirm this and prevent regressions going forward. PR: https://github.com/appcelerator/alloy/pull/161 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-594 The app can be run with 2 possible settings in the *config.json* file: 1.
    "useAlloyModel": true
    This will use a full-fledged Alloy model to test the issue. Since it uses the sql adapter, this setting can only be tested on iOS and Android 2.
    "useAlloyModel": false
    This can be tested on all supported platforms as it uses plain old Backbone models and no persistence To confirm functional testing, when the app is run it should present the attached screenshot showing filtered and transformed models in a collection named *collection* that are represented as rows.
  5. Federico Casali 2013-07-15

    Verified as fixed. Environment: Titanium SDK 3.1.2.v20130710144553 Appcelerator Studio 3.1.2.201307101037 Alloy 1.2.0 Android 4.2.2 and iOS 5. MobileWeb checked for case #2 (no SQL adapter) Closing.

JSON Source