Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1251] Alloy: if-condition on required proxy property missing form assigning that property

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sAlloy 1.5.1, Alloy 1.7.0
Fix Version/sn/a
ComponentsXML
Labelsproxy, require, views
ReporterFokke Zandbergen
AssigneeTim Poulsen
Created2015-02-19T10:40:19.000+0000
Updated2015-02-19T10:40:19.000+0000

Description

If you require a controller for a proxy property then run-time conditions are not properly applied in the compiled code. Creating the instance of the required controller has the condition, but assigning the proxy property hasn't, as the following example shows: *index.xml*
<Alloy>
  <Window id="win">
    <ListView>
      <Require src="footer" if="Alloy.Globals.footer" />
    </ListView>
  </Window>
</Alloy>
*footer.xml*
<Alloy>
  <FooterView>
    <Label>Hello</Label>
  </FooterView>
</Alloy>
*compiled*
    Alloy.Globals.footer && ($.__views.__alloyId5 = Alloy.createController("footer", {
        id: "__alloyId5"
    }));
    $.__views.__alloyId2 = Ti.UI.createListView({
        footerView: $.__views.__alloyId5.getProxyPropertyEx("footerView", {
            recurse: true
        }),
        id: "__alloyId2"
    });

Comments

No comments

JSON Source