Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15252] Android: Cannot reference proxy methods

GitHub Issuen/a
TypeStory
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, proxy, reference
ReporterFokke Zandbergen
AssigneeUnknown
Created2013-08-19T13:37:47.000+0000
Updated2018-02-28T20:04:23.000+0000

Description

On iOS you can do:
var w = Ti.UI.createWindow({
    backgroundColor: 'white'
});

w.open();

var setter = w.setBackgroundColor;

setter('green');
But on Android you'll get:
08-19 15:23:55.515: E/V8Exception(23104): Exception occurred at app.js:7: Uncaught TypeError: Illegal invocation
This is unfortunate, because this means you cannot link an Alloy widget's exported methods through to one of it's view elements.

Comments

  1. Martin Guillon 2013-09-11

    I dont think you can get a reference to a method like that on Android. It is because of the native implementation

JSON Source