CLONE - When JavaScript calls back to the JavaFX Applet, it is not on the Main JavaFX thread.

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Not an Issue
    • Priority: P4
    • fx2.0
    • Affects Version/s: fx1.3
    • Component/s: deploy
    • Environment:

      JavaFX 1.0
      snv_102 i86pc.

      I found the hard way that I had to use FX.deferAction()
      when calling back to JavaFX from JavaScript.

      // The applet uses this to set the current Image shown
      public function setCurrentPic(ndx:Integer) : Void {
        FX.deferAction(function(): Void {
            try {
                imageList.setIndex(ndx);
            } catch(ex: java.lang.Exception) {
                applet.eval("alert('{ex}')");
            }
        });
      }

      Without the deferAction() it sometimes would work, other times I would
      get a SecurityException when trying to fetch the associated image off the net.
      With deferAction it all seems to work fine.

      I would have thought that this would be automagically done
      by the JavaScript to JavaFX framework?

            Assignee:
            Igor Nekrestyanov (Inactive)
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: