ripple-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomasz Trejderowski (JIRA)" <>
Subject [jira] [Commented] (RIPPLE-36) Ripple Emulator under Windows doesn't fire events
Date Fri, 20 Sep 2013 07:09:55 GMT


Tomasz Trejderowski commented on RIPPLE-36:

This is a [public repository|], so you can browse
/ check / test code, whenever you have some spare time and willing to do so. Event binding
is done in [/assets/app.js|]
and it goes like this (unrelated parts removed):

bq. var app = 
    initMode: false,
    debugMode: window.tinyHippos != undefined,
    init: function()
        app.initMode = true;
        document.addEventListener('deviceready', app.deviceReadyHandler, false);
        if(app.debugMode) app.deviceReadyHandler();

    deviceReadyHandler: function()
         * Actual handler, to handle app's exits (back button press).
         * With fix for nasty bug of Ripple having deadly old PhoneGap 2.0.0 behind!
        if(!app.debugMode) document.addEventListener("backbutton", app.backButtonHandler,
         * Battery-related and menu button press events handlers.
         * Used as real events in this application -- i.e. has some function.
        document.addEventListener('menubutton', app.menuButtonHandler, false);
        document.addEventListener('batterylow', app.batteryLowHandler, false);
        document.addEventListener('batterystatus', app.batteryStatusHandler, false);
        document.addEventListener('batterycritical', app.batteryCriticalHandler, false);
         * Demo purpose only events handlers.
         * Meaningless in this application, just throwing info to console / event log.
        document.addEventListener('pause', app.pauseHandler, false);
        document.addEventListener('resume', app.resumeHandler, false);
        document.addEventListener('online', app.onlineHandler, false);
        document.addEventListener('offline', app.offlineHandler, false);
        document.addEventListener('searchbutton', app.searchButtonHandler, false);
        document.addEventListener('endcallbutton', app.endCallButtonHandler, false);
        document.addEventListener('volumeupbutton', app.volumeUpButtonHandler, false);
        document.addEventListener('startcallbutton', app.startCallButtonHandler, false);
        document.addEventListener('volumedownbutton', app.volumeDownButtonHandler, false);


This works just fine on mobile device, but fails completely on Ripple. Ripple adds comment
to console, that it is firing particular event (when proper button in UI is used), but it
actually fails to do it. If (like in this example) important app's init part is written in
{{deviceready}} event, then entire application fails to run under Ripple, because Ripple itself
fails to fire that event (either manually fired or upon page load / refresh). In such situation
I have to help myself with:

bq. document.addEventListener('deviceready', app.deviceReadyHandler, false);
if(app.debugMode) app.deviceReadyHandler();

Or else I won't be able to debug entire application in Ripple at all.
> Ripple Emulator under Windows doesn't fire events
> -------------------------------------------------
>                 Key: RIPPLE-36
>                 URL:
>             Project: Apache Ripple
>          Issue Type: Bug
>         Environment: Windows 7 Home Edition, x86, Chrome browser (newest stable version),
Ripple Emulator extension for Chrome (newest stable version taken from Chrome Store).
>            Reporter: Tomasz Trejderowski
> Under Windows, Ripple Emulator doesn't fire events. Neither automatically (deviceready)
nor manually (using 'Event' pane). After selecting event and clicking button to fire it, Ripple
writes down info to console, that it fires particular event, but nothing happens -- application
does not react at all. When main init code is moved to 'deviceready' event, application fails
to start under Ripple Emulator, as this event isn't fired.
> Everything works just fine (both application startup and events' binding) under real
mobile device -- problem limited to Ripple Emulator only and therfore code seems to be fine.
> Details at Stack Overflow:

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message