[ALOY-1545] Broken Widget event translation. Custom events on Widgets are being applied to the Widget's root View instead of the Widget's Controller itself, causing an error.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2017-04-09T05:33:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | alloy 1.9.11 |
Components | n/a |
Labels | defect |
Reporter | Ranando King |
Assignee | Feon Sua Xin Miao |
Created | 2017-03-03T18:13:46.000+0000 |
Updated | 2017-04-10T17:18:45.000+0000 |
Description
It only occurs when data binding.
*Steps to reproduce:*
Add the widget to the template TableViewRow using the
/alloy/controllers/.js shows:
/alloy/controllers/.js shows:
Create an app.
Create a widget that triggers an event against its own controller, say "event".
Create a Model.
Add a TableView to index.js
Add a Collection for the model to index.js
Configure the TableView for data binding.
Add a TableViewRow as a template for the databound TableView.
Add the widget to the template TableViewRow using the Alloy tag.
Add an onEvent handler to the widget tag.
Build the app.
*Actual Result:* App throws "*{color:red}undefined is not a function{color}*" error Resources/onEvent ? test.getViewEx({
recurse: true
}).on("event", <yourhandlermethod>) : __defers["test.getViewEx({recurse:true})!event!<yourhandlermethod>"] = true;
*Expected Result:*
App runs as expected.
Resources/onEvent ? test.on("event", <yourhandlermethod>) : __defers["test!event!<yourhandlermethod>"] = true;
Attachments
File | Date | Size |
---|---|---|
errorDemo.zip | 2017-03-03T20:50:19.000+0000 | 9685212 |
Hello, Attach a sample project for us to test. Thanks.
A 10MB limit on file sizes makes it almost impossible to create a package small enough to meet the limit and still be immediately workable when unzipped, especially when you consider that the default /app/assets directory is almost 10MB by itself for an Alloy app. That limit needs to be raised to at least 15MB.
Hello, Please attach in dropbox and provide the link. Thanks.
I've already attached a file: errorDemo.zip. I was merely commenting that the upload limit set on this system is too small considering the size of an unmodified project directory.
There are other issues with the templatizing system as well. * attributes like "class" and "onXxxx" cannot be templatized. I understand why that would be true for "class" since that is used by the alloy processor at design-time when the template value is only available at runtime. However, this is not the case for event handlers. Since the template instantiating function just translates " id='test' onEvent='
PR: https://github.com/appcelerator/alloy/pull/820 Functional testing should follow the reproduce steps listed in the description. The app should launch without error.