[ALOY-594] Alloy: Naming a collection "collection" will fail
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-20T22:41:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 13 |
Components | Models, Runtime |
Labels | Alloy, bindings, bug, qe-testadded |
Reporter | Daniel Sefton |
Assignee | Tony Lukasavage |
Created | 2013-03-30T14:25:12.000+0000 |
Updated | 2013-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
File | Date | Size |
---|---|---|
Screen Shot 2013-06-20 at 6.40.41 PM.png | 2013-06-20T22:42:01.000+0000 | 42968 |
Can you explain what "datafilter" is?
Hi Tony, Its your generated code: like this:
var __alloyId27 = function(e) { var models = datafilter($.tipcollection), len = models.length, rows = [];
the alloy xml is: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");
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.
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.
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.
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.