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

Lookup for elements in ScrollPane does not work if skin not initialized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8u20
    • fx2.1
    • javafx

      Tried to select my flowpane, result is null. With removing the scrollpane it works as expected.

      Quote description of lookup method:
      "Finds this Node, or the first sub-node, based on the given CSS selector. If this node is a Parent, then this function will traverse down into the branch until it finds a match. If more than one sub-node matches the specified selector, this function returns the first of them. "

      VBox vbox = (VBox )FXMLLoader.load(TestClass.class.getResource(fxml));
      vBox.lookup("#elementsPane");

      <VBox xmlns:fx="http://javafx.com/fxml">
          <ScrollPane fitToHeight="true" fitToWidth="true" VBox.vgrow="ALWAYS">
              <FlowPane fx:id="elementsPane" VBox.vgrow="ALWAYS" vgap="4" hgap="4" alignment="BASELINE_CENTER">
                  <styleClass>
                      <String fx:value="elementsPane" />
                  </styleClass>
              </FlowPane>
          </ScrollPane>
      </VBox>

            dgrieve David Grieve
            ageistjfx Alexander Geist (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: