Titanium JIRA Archive
Alloy (ALOY)

[ALOY-775] Allow a Require to add both (multiple) Templates and ListSections

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sAlloy 1.2.0
Fix Version/sn/a
Componentsn/a
Labelsalloy, itemtemplate, listsection, listview, require, templates
ReporterFokke Zandbergen
AssigneeUnknown
Created2013-08-05T19:24:30.000+0000
Updated2018-03-07T22:25:40.000+0000

Description

The goal

*index.xml*
<Alloy>
    <Window>
        <ListView>
            <Require src="foo" />
        </ListView>
    </Window>
</Alloy>
*foo.xml*
<Alloy>
    <Templates>
        <ItemTemplate name="tpl">
            <Label bindId="label" />
        </ItemTemplate>
    </Templates>
    <ListSection>
        <ListItem template="tpl" label:text="Hello World" />
    </ListSection>
</Alloy>

Current situation

If the come first, nothing is added to the index-controller. If the comes first, the index-controller will act like the *foo* is only providing a ListSection. In the foo-controller it tries to do both but cannot handle the tag.

Proposed solution

For all situations in which is used under a , we should pass both the object holding the templates (*__itemTemplate*) and the array (which would then need to become an object as well) holding the sections. This way, the required controller can add multiple ListSections (TC-2692) and/or Templates.

Comments

No comments

JSON Source