Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8089546

JavaFX Webview clicks in JDK 7u13 suddenly stop working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • javafx
    • None
    • Windows 7 64bits, Windows 8 64 bits. Both with JDK 32 and 64 bits. Also fails on Mac 10.8.2

    • web

      I have a JavaFX project that works pretty well with the JavaFX included in the JDK 7 u10, but it suddenly stop working with the latest revision 13. At first, the JSObject class has been moved and now is only available from the netscape package. This does not seem to be a problem since I can still call Javascript functions from Java and get its return value without any problem. However, in the the Webview i have loaded a Google Map that is listening for clicks on the map to call a Java callback. The function listening for clicks seems to be working fine since I have tested it from an external browser and the clicks are captured fine. The same code also works with the JDK 7u10. However when switching to JDK 7u13, the javascript function is never called.

      This is the function which is listening for click actions over the map (it is called in the onload):

                  function startListeningLocations(){
                      google.maps.event.addListener(gMap, 'click', onMapClick);
                  }

      The function onMapClick is as the following:

                  function onMapClick(event)
                  {
                      if(window.javacallback){
                          var lat = event.latLng.lat();
                          var lon = event.latLng.lng();
                          window.javacallback.onLocationSelected(lat, lon);
                      }
                  }
          
      The window.javacallback member is a Java class instance that have the function onLocationSelected(double lat, double lon);

      I have tried to see if the problem is that the member is not being established correctly, but this is not the problem. I know that the onMapClick function is never called.

      I have created a sample JavaFX Netbeans project showing this behaviour at this URL: https://dl.dropbox.com/u/22902501/GoogleMaps.zip
      I have two platforms in Netbeans "JDK_1.7" (JDK 1.7_10) and "JDK_1.7_13" (JDK 1.7_13). When compiling and running the app from version 10, if i click any point in the map, there is a console output showing the clicked location. However when I compile and run with JDK version 13, nothing happens.

      Example with JDK 1.7_10:

      compile:
      Detected JavaFX Ant API version 1.2
      Launching <fx:jar> task from /Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/lib/ant-javafx.jar
      Launching <fx:deploy> task from /Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/lib/ant-javafx.jar
      jfx-deployment:
      jar:
      run:
      Location Received: 44.809121700077355,-5.80078125
      Location Received: 44.933696389694674,-9.6240234375
      Location Received: 44.902577996288876,-10.2392578125

      Example with JDK 1.7_13:

      compile:
      Detected JavaFX Ant API version 1.2
      Launching <fx:jar> task from /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/lib/ant-javafx.jar
      Launching <fx:deploy> task from /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/lib/ant-javafx.jar
      jfx-deployment:
      jar:
      run:

      (Nothing happens when clicking on map)

            Unassigned Unassigned
            duke J. Duke
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: