Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2170] Android: regression in Ti.App.fireEvent from within WebView context on 1.5 trunk

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:18.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, android_refactor, events, fireevent, patch, regression, ti.app, webview
ReporterBrion Vibber
AssigneeMarshall Culpepper
Created2011-04-15T03:12:34.000+0000
Updated2011-04-17T01:58:18.000+0000

Description

In testing StatusNet Mobile against the new 1.5 Android code in trunk, I've found that custom application events fired from JavaScript code running within a WebView no longer work. This is needed for our app to communicate between the main UI code and the WebView that displays our message timelines.

I believe I've tracked it to commit 7926eda7aad2fa2073aad2849f4ed890c5807e00

This commit removes AppModule.fireEvent(), which used to override the default KrollProxy event handler function with a call to fireAppEvent() on the current app retrieved from the current context. I believe that breaks the code in TiWebViewBinding.AppBinding.fireEvent(), which calls fireEvent() directly on a private AppModule instance.

With the AppModule.fireEvent() hack removed, it looks like that'll just fire events on the individual instance and not call the global application.

Comments

  1. Brion Vibber 2011-04-15

    Provisional fix that works for me:

    http://github.com/brion/titanium_mobile/tree/2170">http://github.com/brion/titanium_mobile/tree/2170
    http://github.com/brion/titanium_mobile/commit/73a02241a1df8b1697e91732861020efda9d6724"> http://github.com/brion/titanium_mobile/commit/73a02241a1df8b1697e9...
    http://github.com/appcelerator/titanium_mobile/pull/9">http://github.com/appcelerator/titanium_mobile/pull/9

  2. Marshall Culpepper 2011-04-15

    (from [9a3a817dd712309535cad518dae779ce24b7d5ba]) pull the App and API modules from TiApp instead of creating them for each instance, thanks to Brion Vibber for the find and suggestion. also cleared up some warnings [#2170 state:fixed-in-qa] http://github.com/appcelerator/titanium_mobile/commit/9a3a817dd712309535cad518dae779ce24b7d5ba"> http://github.com/appcelerator/titanium_mobile/commit/9a3a817dd7123...

  3. Thomas Huelbert 2011-04-15

    Titanium SDK version: 1.5.0 (12/04/10 08:46 b7b9e78)

JSON Source