[ALOY-1251] Alloy: if-condition on required proxy property missing form assigning that property
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Alloy 1.5.1, Alloy 1.7.0 |
Fix Version/s | n/a |
Components | XML |
Labels | proxy, require, views |
Reporter | Fokke Zandbergen |
Assignee | Tim Poulsen |
Created | 2015-02-19T10:40:19.000+0000 |
Updated | 2015-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"
});
No comments