Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14631] BlackBerry: Not able to get e.source on click event for UI controls such as window, view, button etc

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-08-01T23:02:27.000+0000
Affected Version/sRelease 3.1.2
Fix Version/s2013 Sprint 16, 2013 Sprint 16 API, Release 3.2.0
ComponentsBlackBerry
Labelsqe-3.1.2, qe-testadded
ReporterPriya Agarwal
AssigneePedro Enrique
Created2013-07-23T12:08:29.000+0000
Updated2014-02-20T00:49:58.000+0000

Description

Not getting e.source on click event for UI controls. Checked with view,button and window. This is not a regression. Steps to reproduce: 1) Make a test Project and replace app.js with the code given below. 2) Launch the app. 3) After the app gets launched. Click the button.
var win = Ti.UI.createWindow({backgroundColor:'white'});
  
var btn = Ti.UI.createButton({
    title: 'click me',
    height: 50,
    width: 150,
    color:'black'
});
 
btn.addEventListener('click',function(e){
    alert(JSON.stringify(e.source));
});
win.add(btn);
win.open();
Actual Result: Do not get anything it just returns empty JSON as"{}" Expected Result:It must return button properties as in ios and android.

Comments

  1. Pedro Enrique 2013-08-01

    First pass:
    e.source
    does in fact return the JS obect called, i.e. Button, Window, etc. But the log outputs nothing.
  2. Pedro Enrique 2013-08-01

    Conclusion: When setting a TiProxy to TiProxy property, in this case the message on the alert, it would get ignored. if the property is not a proxy, then it would work. Fixed by rewriting the way we set properties on init. PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/142
  3. Priya Agarwal 2013-11-12

    Getting e.source on click event for UI controls such as window, view, button etc. Checked for view and button. Hence Closing the issue. Tested Environment: Appcelerator Studio: 3.2.0.201311120707 SDK:3.2.0.v20131111174605 alloy: 1.3.0 acs: 1.0.7 npm: 1.3.2 titanium: 3.2.0 titanium-code-processor: 1.0.3 Xcode:5.0.1 Device: Blackeberry Z 10 OS: Mac OSX 10.9

JSON Source