Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1906] Android: Event Source Gets Reset

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:57:30.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, defect
ReporterDon Thorp
AssigneeDon Thorp
Created2011-04-15T03:05:16.000+0000
Updated2011-04-17T01:57:30.000+0000

Description

When an event is fired in a child and propagated up the tree, the source is getting set to the proxy that's firing it and does not preserve the initial source.

See http://developer.appcelerator.com/helpdesk/view/45061">Helpdesk 45061

var w = Ti.UI.createWindow({ backgroundColor : 'blue' , name : 'w'});
w.addEventListener('focus', function(e) {
    Ti.API.info("Window Focus: " + e.type + " " + e.source + " " + e.source.name);
});

var b = Ti.UI.createButton({ title : 'Click Me', width : 100, height : 50 , top : 20, name : 'b'});
b.addEventListener('focus', function(e) {
    Ti.API.info("Button Focus: " + e.type + " " + e.source + " " + e.source.name);
});

var b1 = Ti.UI.createButton({ title : 'Click Me', width : 100, height : 50, top : 90, name : 'b1' });
b1.addEventListener('focus', function(e) {
    Ti.API.info("Button 1 Focus: " + e.type + " " + e.source + " " + e.source.name);
});

w.add(b);
w.add(b1);

w.open({ animated : false});

http://img.skitch.com/20100924-xt69d7yk3s5n5w81rfrapamgp6.png" alt="screenshot">

Comments

  1. Don Thorp 2011-04-15

    (from [66b7aa975c491b00c7c58e0aa97a95b41d183e4f]) [#1906 state:fixed-in-qa] the problem was that if a null event object was passed, it wasn't being created at the initial fireEvent location. Therefore each proxy was creating its own event object and setting itself as the source. Some view event's like 'click' set the source explicitly so masked the underlying problem. http://github.com/appcelerator/titanium_mobile/commit/66b7aa975c491b00c7c58e0aa97a95b41d183e4f"> http://github.com/appcelerator/titanium_mobile/commit/66b7aa975c491...

  2. Thomas Huelbert 2011-04-15

    thanks for the screenshot :)

    closed against 1.6 G1 and a sim running 2.2

JSON Source