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

WebEngine goes in State SUCCEEDED but Document is null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • web

      As reported in this forum post:

      "I'm trying to develop a JavaFX web page loader. I want to explore the DOM tree after page loading, so I load the DOM after I receive a Worker State SUCCEEDED, but the problem in that when I test my code on the url: www.repubblica.it, I got SUCCEEDED but the DOM is still null.

      It seems to be that the page is not completely loaded although I got the SUCCEEDED event.

      This is the piece of code that fails:

      webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<Worker.State>() {
      @Override
      public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) {
      if (newState == Worker.State.SUCCEEDED) {
      webEngine.getDocument(); // On www.repubblica.it dom is still null
      }
      }
      });
      "

            vbaranov Vasiliy Baranov (Inactive)
            peterz Peter Zhelezniakov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: