[ALOY-1080] Compiler fails with misleading message when dataCollection set on ListView rather than ListSection
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-07-23T15:06:46.000+0000 |
Affected Version/s | Alloy 1.4.0, Alloy 1.3.1 |
Fix Version/s | Alloy 1.5.0 |
Components | XML |
Labels | qe-manualtest |
Reporter | Tim Poulsen |
Assignee | Feon Sua Xin Miao |
Created | 2014-07-09T13:49:04.000+0000 |
Updated | 2014-09-14T21:08:56.000+0000 |
Description
If the
dataCollection
attribute is set on the ListView, as shown below, the Alloy compiler fails with the message that the ItemTemplate must have a name attribute (which it does in the example).
<Alloy>
<Collection src="mycollection"/>
<Window id="win">
<ListView id="thelist" defaultItemTemplate="listTemplate" dataCollection="mycollection">
<Templates>
<ItemTemplate name="listTemplate">
<Label bindId="mylabel" id="mylabel"/>
</ItemTemplate>
</Templates>
<ListSection id="mainsection">
</ListSection>
</ListView>
</Window>
</Alloy>
Moving the dataCollection
attribute to the ListSection tag resolves the issue.
This might be primarily a documentation issue -- that the list section is what you bind to your collection. However, the error message should be more meaningful and accurate.
Attachments
File | Date | Size |
---|---|---|
Screen Shot 2014-07-09 at 9.19.59 AM.png | 2014-07-09T13:49:05.000+0000 | 91600 |
PR: https://github.com/appcelerator/alloy/pull/490 Test app: https://github.com/feons/alloy/tree/ALOY-1080/test/apps/testing/ALOY-1080 Functional Test: Run the test app, Alloy compilation should fail with an error message identify the problem that
dataCollection
attribute is set on ListView.PR merged
Error received using the sample code is:
TiSDK 3.4.0.v20140913174915 Appcelerator Studio 3.4.0.201409131030 CLI 3.4.0-rc3 Alloy 1.5.0-rc2 Xcode6 GM Closing