[ALOY-665] Using namespace in markup event
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-20T02:59:40.000+0000 |
Affected Version/s | Alloy 1.1.3 |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 13 |
Components | Runtime, XML |
Labels | alloy, qe-testadded |
Reporter | Navid Ghahramani |
Assignee | Tony Lukasavage |
Created | 2013-05-22T03:00:30.000+0000 |
Updated | 2013-07-15T22:32:30.000+0000 |
Description
Hi,
I got this error when I use namespace in markup event.
For example:
Home.xml
<Button id="orderButton" onClick="Home.onOrderClick"></Button>
Home.js
var Home = {}
Home.onOrderClick = function() {
}
I got this error:
undefined' is not an object (evaluating 'Home.onOrderClick')
then I opened compiled Home.js and I saw this:
Home.onOrderClick ? $.__views.orderButton.addEventListener("click", Home.onOrderClick) : __defers["$.__views.orderButton!click!onOrderClick"] = true;
I think you can fixed it with this code
Home != null && Home.onOrderClick ? $.__views.orderButton.addEventListener("click", Home.onOrderClick) : __defers["$.__views.orderButton!click!onOrderClick"] = true;
Thanks
PR: https://github.com/appcelerator/alloy/pull/159 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-665 Functional testing can be passed by successfully running the app on all supported platforms. The fact that the app runs without a runtime error on initial load indicates that the bug is fixed. You can additionally test by generating touchstart, touchend, and swipe events. Confirming that all 3 events pop up in the console log will further attest to its improvement, but this is not entirely necessary as I don't want any possible platform disparities to be interpreted as issues directly related to this ticket.
Verified as fixed. Environment: Titanium SDK 3.1.2.v20130710144553 Appcelerator Studio 3.1.2.201307101037 Alloy 1.2.0 Android 4.2.2 and iOS 5 Closing.