[ALOY-305] Event callbacks defined in markup are not working for Windows defined in NavigationGroup
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Resolved |
| Resolution | Fixed |
| Resolution Date | 2012-09-27T20:37:30.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | 2012 Sprint 20, Release 3.0.0 |
| Components | XML |
| Labels | n/a |
| Reporter | Benjamin Hatfield |
| Assignee | Unknown |
| Created | 2012-09-27T17:25:23.000+0000 |
| Updated | 2018-03-07T22:25:50.000+0000 |
Description
REPRODUCTION:
See code below. Ran on iPhone emulator.
RESULTS:
Click event (as well as others) is not executing the callback.
WORKAROUNDS:
Place "win2" inside it's own view and require it in the main view. Callbacks work. Also, using the $.win2.on or $.win2.addEventListener method work in the controller.
index.xml:
<Alloy>
<Window>
<NavigationGroup id="nav" platform="ios,mobileweb">
<Window id="win2" title="Red Window" backgroundColor="red" onClick="report" />
</NavigationGroup>
</Window>
</Alloy>
index.js:
function report (e) {
Ti.API.info("event fired:" + e.type);
}
$.index.open();
Fixed in NavGroup and SplitWindow. No other current parsers contained this error. Fix will be available in 0.2.36 soon.