Titanium JIRA Archive
Alloy (ALOY)

[ALOY-678] Adding child Views to Ti.UI.View in ItemTemplate fails

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-12T20:29:21.000+0000
Affected Version/sAlloy 1.2.0
Fix Version/sAlloy 1.2.0, 2013 Sprint 12
ComponentsRuntime, XML
Labelsqe-testadded
ReporterTiman Rebel
AssigneeTony Lukasavage
Created2013-05-29T15:48:54.000+0000
Updated2013-07-15T21:46:10.000+0000

Description

In the new Alloy 1.2.0 it is possible to define ListView ItemTemplates in the View.xml (#ALOY-608)
<Alloy>
    <ListView id="list" defaultItemTemplate="track">
        <Templates>
            <ItemTemplate name="track" >
                <ImageView bindId="avatar" class="avatar" />
            </ItemTemplate>
        </Templates>
    </ListView>
</Alloy>
You can't use Ti.UI.View with child Views however. (It works without child Views though) Works:
<Alloy>
    <ListView id="list" defaultItemTemplate="track">
        <Templates>
            <ItemTemplate name="track" >
                <View />
            </ItemTemplate>
        </Templates>
    </ListView>
</Alloy>
Does not work:
<Alloy>
    <ListView id="list" defaultItemTemplate="track">
        <Templates>
            <ItemTemplate name="track" >
                <View>
                    <ImageView bindId="avatar" class="avatar" />
                </View>
            </ItemTemplate>
        </Templates>
    </ListView>
</Alloy>
This can be solved to allow further nesting of childTemplates. See http://docs.appcelerator.com/titanium/latest/#!/guide/ListViews-section-37521650_ListViews-ItemTemplate It might be that it is already implemented, but that I hit a bug, because the generated code fails on:
var __alloyId32={type:'Ti.UI.View',var __alloyId33=[]
[ERROR] :  Alloy compiler failed

Attachments

FileDateSize
Screen Shot 2013-06-12 at 4.19.47 PM.png2013-06-12T20:29:46.000+000048931
Screen Shot 2013-06-12 at 4.19.57 PM.png2013-06-12T20:29:46.000+000038555

Comments

  1. Tony Lukasavage 2013-06-12

    PR: https://github.com/appcelerator/alloy/pull/155 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-678 This test will functionally pass simply by running on both iOS and Android, showing all of the ugly, nested rows contained in the app. I attached 2 screenshots to show the expected state of the loaded app on android and ios.
  2. 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 device 4.2.2 and iOS 5 Closing.

JSON Source