[ALOY-682] Alloy: Prevent default ID for a view's root element to be used by child element
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-07-12T00:58:01.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 14, 2013 Sprint 12 |
Components | XML |
Labels | community, qe-closed-3.1.2, qe-testadded |
Reporter | Carter Lathrop |
Assignee | Tony Lukasavage |
Created | 2013-05-31T07:36:59.000+0000 |
Updated | 2013-08-19T07:23:04.000+0000 |
Description
By default, the first root-level element of a view will get the view's name as ID. If you assign the same ID to a child element, this will result in conflicts.
I would suggest a simple check to be made by the compiler, which I will add as a PR soon.
PR: https://github.com/appcelerator/alloy/pull/148 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-682 To functionally test: * Run the test app and ensure that it compiles and loads without error * Modify "app/views/index.xml" and add
id="index"
to theAfter inspecting a few apps, making this a hard error at compile time is causing a lot of issues with existing apps and would require significant refactoring in some. I am going to keep the check in place, but make it a warning message instead of a breaking error.
PR: https://github.com/appcelerator/alloy/pull/175 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-682 To functionally test: * Run the test app and ensure that it compiles and loads without error * Check the alloy compile log. Ensure that you see 2 warnings about using the default ID. One warning from the "index" view, one warning from the "another" view.
Verified as fixed on Android and iOS devices. Environment: Titanium SDK 3.1.2.v20130710144553 Appcelerator Studio 3.1.2.201307101037 Alloy 1.2.0 Closing
I see that the warning is given even if the top-level element has another ID then the default one. I think in that case the warning should not be given.