[ALOY-1564] Broken Require data-binding event translation. Custom events on Required views are being applied to the required root View instead of the required Controller itself, causing an error.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2017-08-17T03:33:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | CLI Release 6.2.4 |
Components | Tooling |
Labels | n/a |
Reporter | Brian GarcĂa |
Assignee | Feon Sua Xin Miao |
Created | 2017-05-22T12:35:55.000+0000 |
Updated | 2017-08-17T03:34:07.000+0000 |
Description
When requiring a view with data binding, for instance:
<ScrollView dataCollection="clclients" layout="vertical" class="Size">
<Label text="{name}" class="header Size" top="10"/>
<Require src="products" name="{name}" onClick="doSomething" type="view"/>
</ScrollView>
the following errors is firing:
[ERROR] : Script Error {
[ERROR] : column = 18;
[ERROR] : line = 40;
[ERROR] : message = "undefined is not a function (evaluating '__alloyId146.getViewEx({\n recurse: true\n }).on(\"click\", doSomething)')";
[ERROR] : stack = "__alloyId148\ntriggerEvents\ntrigger\n_onModelEvent\ntriggerEvents\ntrigger\nset\nsuccess\n\nonload";
[ERROR] : }
due to this processed code:
doSomething ? __alloyId146.getViewEx({
recurse: true
}).on("click", doSomething) : __defers["__alloyId146.getViewEx({recurse:true})!click! doSomething"] = true;
which should be:
doSomething ? __alloyId146.on("click", doSomething) : __defers["__alloyId146!click! doSomething"] = true;
PR: https://github.com/appcelerator/alloy/pull/840