Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10316] Blackberry: User defined properties at creation not set on proxy object.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2012-09-19T15:29:46.000+0000
Affected Version/sn/a
Fix Version/sSprint 2012-19 BB, BB Preview 3
ComponentsBlackBerry
Labelsn/a
ReporterHayk Zakaryan
AssigneeJosh Roesslein
Created2012-08-06T02:06:12.000+0000
Updated2017-03-03T01:02:00.000+0000

Description

If you pass in custom properties when creating a proxy, they are never set on the proxy object.

Simplified Test Case

var view = Ti.UI.createView({myProperty: 123});
Ti.API.info('view.myProperty = ' + view.myProperty);
Expected: view.myProperty equals 123 Actual: view.myProperty is not defined

KitchenSink Regression

ev.source - should return the Object that fired the event. If create a label as var label = Ti.UI.createView({backgroundColor:'orange',width:100,height:100,top:10,name:"view a"}); Than add 'click' event listener on Label as label.addEventListener('click',function(ev){}); ev.source should have name attribut equals to 'view a'. This is not working for Blackberry. Corresponding code can be found in KS - Resources\ui\common\baseui\view_event_propagation.js

Comments

  1. Jean-Philippe Lemieux 2012-08-22

    This issue seems to affect all events from all objects
  2. Josh Roesslein 2012-09-18

    The problem actually appears to be that user defined properties based at creation are not being copied into the object. So later on when you try to access them they are not found.

    Example

       var view = Ti.UI.createView({myCustomProperty: '123'});
       view.myCustomProperty; // should be '123'
       
    Expected: myCustomProperty should equal '123' Actual: myCustomProperty is not defined
  3. Josh Roesslein 2012-09-19

    View click event test case.

       var win = Ti.UI.createWindow();
       
       var view = Ti.UI.createView({width:100, height: 100, backgroundColor: 'blue', myProperty:123});
       
       view.addEventListener('click', function(e) {
       	Ti.API.info('view.myProperty = ' + e.source.myProperty);
       })
       
       win.add(view);
       
       win.open();
       
  4. Josh Roesslein 2012-09-19

    I have seen duplicate "click" events firing with the recent R8 upgrade. Could be a possible regression. If so we should open a new ticket to address it.
  5. Lee Morris 2017-03-03

    Closing ticket as Blackberry is no longer supported.

JSON Source