Titanium JIRA Archive
Alloy (ALOY)

[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 Issuen/a
TypeBug
PriorityCritical
StatusResolved
ResolutionFixed
Resolution Date2017-08-17T03:33:23.000+0000
Affected Version/sn/a
Fix Version/sCLI Release 6.2.4
ComponentsTooling
Labelsn/a
ReporterBrian GarcĂ­a
AssigneeFeon Sua Xin Miao
Created2017-05-22T12:35:55.000+0000
Updated2017-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;

Comments

  1. Feon Sua Xin Miao 2017-07-27

    PR: https://github.com/appcelerator/alloy/pull/840

JSON Source