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

[Pagination] Set current page index issue.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8
    • javafx
    • jdk1.8.0b74

      To reproduce:
      1. Click the button "Set current page index";
      2. Visible buttons are 10 - 14. It is supposed that it would be 11-15.
      3. Click the button "Go to beginning".
      4. Push right arrow until the button "6" appears;
      5. Then click "Set current page index". Now the range is 11 - 15.

      It turns out that set current page index shows different button ranges depending on the current state of control.

      public void start(Stage stage) {

              HBox root = new HBox(20d);

              final Pagination pg = new Pagination();
              pg.setMaxPageIndicatorCount(5);
              pg.setPageCount(100);
              pg.setMinSize(200.0, 200.0);
              pg.setPrefSize(200.0, 200.0);
              
              Button btn = new Button("Set current page index");
              btn.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      pg.setCurrentPageIndex(13);
                  }
              });
              
              Button btn2 = new Button("Go to beginning");
              btn2.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      pg.setCurrentPageIndex(1);
                  }
              });

              VBox vb = new VBox(3.34);
              vb.getChildren().addAll(btn, btn2);
              
              root.getChildren().addAll(pg, vb);
              
              Scene scene = new Scene(root, 400, 250);

              stage.setScene(scene);
              stage.setTitle(System.getProperty("java.runtime.version") + "; " + System.getProperty("javafx.runtime.version"));
              stage.show();
          }

            Unassigned Unassigned
            dzinkevi Dmitry Zinkevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported: