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

[CSS, SceneGraph] Node lookup with TabPane

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u40
    • 8u20
    • javafx
    • None
    • java version "1.8.0_20-ea"
      Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.20-b17, mixed mode)

      Looking up a node with TabPane.lookupAll does not return any result.
      This seems to be the caused by the children not being filled with the content nodes of the single tabs.
      Maybe this is affects more nodes eg. like Accordion?

      Test:
        public void testLookup() throws Exception {
          TabPane tabPane = new TabPane();
          Tab tab1 = new Tab("tab1");
          tabPane.getTabs().add(tab1);

          StackPane content = new StackPane();
          TextField nodeWithId = new TextField();
          nodeWithId.setId("test");
          content.getChildren().add(nodeWithId);
          tab1.setContent(content);
          assertSame(nodeWithId, content.lookup("#test"));
          Set<Node> idNodes = tabPane.lookupAll("#test");
          assertEquals(1, idNodes.size());
          assertSame(nodeWithId, tabPane.lookup("#test"));
        }

            dgrieve David Grieve
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: