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

[Pagination] fails with exception, when current page index property is binded initially.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u20
    • 7u6
    • javafx
    • 2.2.0b20

      Code:

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Pagination;
      import javafx.scene.control.Slider;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class JavaApplication50 extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              VBox vb = new VBox();

              final Pagination pg = new Pagination();

              final Slider s1 = new Slider(-10, 100, 5);

              pg.currentPageIndexProperty().bind(s1.valueProperty());

              vb.getChildren().addAll(pg, s1);

              Scene scene = new Scene(vb, 300, 300);
              stage.setScene(scene);
              stage.show();
          }
      }


      Exception:
      java.lang.RuntimeException: A bound value cannot be set.
      at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:159)
      at javafx.scene.control.Pagination.setCurrentPageIndex(Pagination.java:276)

      to reproduce, just run the code.

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

              Created:
              Updated:
              Resolved:
              Imported: