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

TableColumn sorting not working for columns of boolean data with column grouping

    XMLWordPrintable

Details

    Description

      It sorts the first time (false first) and then that's it, the triangle keeps on changing but no sort occurs



      List<Boolean> data = new ArrayList(10);
              for (int i = 0; i < 10; i++) {
                  data.add(new Boolean(i % 2 == 0));
              }
              TableView<Boolean> tv = new TableView<Boolean>();
              tv.getItems().setAll(data);

              TableColumn tc0 = new TableColumn("Parent");
              tv.getColumns().add(tc0);

              TableColumn<Boolean, Boolean> tc1 = new TableColumn<Boolean, Boolean>("Col1");
              tc1.setCellValueFactory(new Callback<CellDataFeatures<Boolean, Boolean>, ObservableValue<Boolean>>() {
                  @Override
                  public ObservableValue<Boolean> call(
                          CellDataFeatures<Boolean, Boolean> param) {
                      return new ReadOnlyObjectWrapper<>(param.getValue());
                  }
              });
              tc0.getColumns().add(tc1);

              TableColumn<Boolean, Boolean> tc2 = new TableColumn<Boolean, Boolean>("Col2");
              tc2.setCellValueFactory(new Callback<CellDataFeatures<Boolean, Boolean>, ObservableValue<Boolean>>() {
                  @Override
                  public ObservableValue<Boolean> call(
                          CellDataFeatures<Boolean, Boolean> param) {
                      return new ReadOnlyObjectWrapper<>(param.getValue());
                  }
              });
              tc0.getColumns().add(tc2);



              Scene scene = new Scene(tv, 300, 250);

              primaryStage.setTitle("Hello World!");
              primaryStage.setScene(scene);
              primaryStage.show();

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            atechnolojfx Anahata Technologies (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: