Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1005] Functions and currentWindow on Android broken

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:54:56.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, defect, kroll
ReporterKonstantin
AssigneeBlain Hamon
Created2011-04-15T02:41:20.000+0000
Updated2011-04-17T01:54:56.000+0000

Description

Platform 1.3.0 OS MacOSX/WinXP, iPhone emulator 3.1.3, android emulator 2.1

Please take a look at example on the documentation page for Titanium.UI.Window, "Passing data" section. You have variable a and method b. I tried to reproduce this in my project. In app.js I have method, variable, TabGroup, 2 Tabs which have windows created with url property and a and b attached. I can access a and b from child window on iPhone, but only variable a on Android. When I try to call method b, smth. like Titanium.UI.currentWindow.b() I get an error from rhino JS library, smth. like "b is not a method, it's an object and not callable". Actually it's true, on Android, b is an object of KrollContext, not function, I can see this when I print Titanium.UI.currentWindow.b to standard output. I even can call Titanium.UI.currentWindow.b.call() and it even works but I can't pass any arguments to b, anyway, IMHO this feature is totally broken on Android. iPhone is OK here

Comments

  1. Konstantin 2011-04-15

    Correction: not KrollContext but KrollCallback

  2. Konstantin 2011-04-15

    Finally I'd like to say, it's not only problem of currentWindow property, any *Proxy object's custom methods have same problem, for example:

       var object = Ti.Module.createSomething({});
       object.specialHandler = function(arg){/*Handler here*/};
       //Somewhere inside handler
         this.specialHandler('parameter');
       

    raises same error, specialHandler is not a method anymore. It's a blocking bug for me on Android

  3. Don Thorp 2011-04-15

    This is really a duplicate, special case of #915

  4. Marshall Culpepper 2011-04-15

    Confirm this works as it should w/ new Kroll

  5. Marshall Culpepper 2011-04-15

    (from [ad1506dc5a33e2f763f9ec37a6fbd3245c7fb728]) added a test for custom proxy instance methods [#1005 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/ad1506dc5a33e2f763f9ec37a6fbd3245c7fb728"> https://github.com/appcelerator/titanium_mobile/commit/ad1506dc5a33...

  6. Matt Schmulen 2011-04-15

    Pass Titanium SDK version: 1.5.0 (12/01/10 09:30 ac7cfd8) drillbit test Android Sim 1.6/2.1

    android sim 1.6
    https://5111068499667359260-a-appcelerator-com-s-sites.googlegroups.com/a/appcelerator.com/android/screenshots/Screenshot2010-12-02at2.30.47AM.png?attachauth=ANoY7crKsfvMfdez3l27wnG_vOB0igXOd2AW8GVzP33R4KO4JNDSdg0wYeWx8OR34RLcQs0pfHxUiuoIsoVb5OClouqEI_CmWLRvbhD64WJg7KiGw4U6-679XjvXSqApaVCVyGqDjjfcHnceQepDqw0Wky44GDYZpomldZ1mAY0K0qqkI_BWhN2ETrFqCIPUjsjX6ZtLnuIJ5H1eYOg2P-M9OoYJKY6_TozjeA9AGUlbA3qoW-OTVh0%3D&;attredirects=0"> https://5111068499667359260-a-appcelerator-com-s-sites.googlegroups...

    android sim 2.1
    https://5111068499667359260-a-appcelerator-com-s-sites.googlegroups.com/a/appcelerator.com/android/screenshots/Screenshot2010-12-02at2.48.13AM.png?attachauth=ANoY7cqZMHs0_-0NFdd52s4sE13MK769EMBj1VEL9mkQdyPJ_1Lylg56ioZ3EKIhrSl7RMoVTCAI9cY4-jfDs6mOqdJOyP9mQrY28Zjh5vBQGQ6_377a21CU3cn9Al6-wi8damB2gpx5waY3FoILV9l9iIqifi6D5Jue3Rbig8yVLAwmls-q_qLFApWfmRmL9V7zuCx18cVF9-Om9uMmhzz7EKdEBj6cJ1MuzGF5vuOn6vTnexNmgr0%3D&;attredirects=0"> https://5111068499667359260-a-appcelerator-com-s-sites.googlegroups...

  7. krishnan 2011-04-15

    Did this got resolved?

JSON Source