[jbosstools-issues] [JBoss JIRA] (JBIDE-17570) CordovaSim: Phonegap API doesn't work after refresh with javaFx web engine when running against JDK 8

Ilya Buziuk (JIRA) issues at jboss.org
Tue Jun 10 07:19:16 EDT 2014


     [ https://issues.jboss.org/browse/JBIDE-17570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Buziuk updated JBIDE-17570:
--------------------------------

    Steps to Reproduce: 
1. Create new HMT project 
2. Add *Device motion* plugin (org.apache.cordova.core.device-motion)
2. Change index.html
{code}
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name = "format-detection" content = "telephone=no"/>
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Hello Cordova</title>
    </head>	 
     <script>
        document.addEventListener("deviceready", onDeviceReady, false);

        // PhoneGap is ready
        //
        function onDeviceReady() {
            navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);
        }

        // onSuccess: Get a snapshot of the current acceleration
        //
        function onSuccess(acceleration) {
            alert('Acceleration X: ' + acceleration.x + '\n' +
                  'Acceleration Y: ' + acceleration.y + '\n' +
                  'Acceleration Z: ' + acceleration.z + '\n' +
                  'Timestamp: '      + acceleration.timestamp + '\n');
        }

        // onError: Failed to get the acceleration
        //
        function onError() {
        }
        </script>   
    <body>
        <div class="app">
            <div id="deviceready">
                <p class="status pending blink">Connecting to Device</p>
                <p class="status complete blink hide">Device is Ready</p>
            </div>
        </div>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        <script type="text/javascript">
            app.initialize();
        </script>
    </body>
</html>
{code}
3. Run As -> Run with CordovaSim
4. Alert will be shown !alert.png|thumbnail!
5. Push *refresh* button
6. Error: *No alert*

  was:
1. Create new HMT project 
2. Add *Device motion* plugin (org.apache.cordova.core.device-motion)
2. Change index.html
{code}
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name = "format-detection" content = "telephone=no"/>
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Hello Cordova</title>
    </head>	 
     <script>
        document.addEventListener("deviceready", onDeviceReady, false);

        // PhoneGap is ready
        //
        function onDeviceReady() {
            navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);
        }

        // onSuccess: Get a snapshot of the current acceleration
        //
        function onSuccess(acceleration) {
            alert('Acceleration X: ' + acceleration.x + '\n' +
                  'Acceleration Y: ' + acceleration.y + '\n' +
                  'Acceleration Z: ' + acceleration.z + '\n' +
                  'Timestamp: '      + acceleration.timestamp + '\n');
        }

        // onError: Failed to get the acceleration
        //
        function onError() {
        }
        </script>   
    <body>
        <div class="app">
            <h1>asdaasdasd
           </h1>
            <div id="deviceready">
                <p class="status pending blink">Connecting to Device</p>
                <p class="status complete blink hide">Device is Ready</p>
            </div>
        </div>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        <script type="text/javascript">
            app.initialize();
        </script>
    </body>
</html>
{code}
3. Run As -> Run with CordovaSim
4. Alert will be shown !alert.png|thumbnail!
5. Push *refresh* button
6. Error: *No alert*



> CordovaSim: Phonegap API doesn't work after refresh with javaFx web engine when running against JDK 8
> -----------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-17570
>                 URL: https://issues.jboss.org/browse/JBIDE-17570
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: browsersim
>    Affects Versions: 4.2.0.Beta2
>         Environment: windows  / JDK 8
>            Reporter: Ilya Buziuk
>            Assignee: Ilya Buziuk
>             Fix For: 4.2.0.Beta3
>
>         Attachments: alert.png
>
>
> Doesn't work only with *JDK 8* + *javaFx* web engine combo. Due to this issue *livereload* doesn't work properly



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the jbosstools-issues mailing list