A DESCRIPTION OF THE PROBLEM :
When 'editableProperty' of the row is set to 'false', it should not be possible to edit its editable (and pseudo-editable) cells.
Now cells remain editable when the row is set not editable. It's not correct.
This problem is actual both for TableView and TreeTableView.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the attached test case
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Check box in the first column is not selectable
ACTUAL -
Check box in the first column is selectable, while it should not be
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableRow;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.CheckBoxTableCell;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
public class TableViewBug extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
TableView<Object> table = new TableView<>();
table.setEditable(true);
table.getItems().add(new Object());
TableColumn<Object, Boolean> column = new TableColumn<>("Select Me");
column.setCellFactory(p -> new CheckBoxTableCell<>());
table.getColumns().add(column);
table.setRowFactory(p -> {
TableRow<Object> row = new TableRow<>();
row.setEditable(false);
return row;
});
Pane root = new Pane();
root.getChildren().add(table);
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
As a temporary workaround, one can use the utility method suggested in https://stackoverflow.com/a/58905149
FREQUENCY : always
When 'editableProperty' of the row is set to 'false', it should not be possible to edit its editable (and pseudo-editable) cells.
Now cells remain editable when the row is set not editable. It's not correct.
This problem is actual both for TableView and TreeTableView.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the attached test case
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Check box in the first column is not selectable
ACTUAL -
Check box in the first column is selectable, while it should not be
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableRow;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.CheckBoxTableCell;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
public class TableViewBug extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
TableView<Object> table = new TableView<>();
table.setEditable(true);
table.getItems().add(new Object());
TableColumn<Object, Boolean> column = new TableColumn<>("Select Me");
column.setCellFactory(p -> new CheckBoxTableCell<>());
table.getColumns().add(column);
table.setRowFactory(p -> {
TableRow<Object> row = new TableRow<>();
row.setEditable(false);
return row;
});
Pane root = new Pane();
root.getChildren().add(table);
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
As a temporary workaround, one can use the utility method suggested in https://stackoverflow.com/a/58905149
FREQUENCY : always
- relates to
-
JDK-8268295 Tree- and TableCell sub implementations should respect the row editability
-
- Resolved
-