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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:
    • Environment:

      2.2.0b20

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: