use-case: editing a cell and clicking somewhere outside must commit the edit.
Implementation intention seems to be to cancel the edit (which would be wrong, because highly unexpected by users), see discussion inRT-15336 and focusListener installed in Cell constructor.Actually, nothing happens (editor still active, showing the modified data, though).
To reproduce, take sample code ofRT-15205 and add the following (to simulate a typical edit/save situation). Then
- start edit some row and change its content
- click on the save button
expected: editor removed and edited content committed
is: editor visible, edited content not committed
Button save = new Button("save");
save.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
// actual code would be something like save(list.getItems());
// simulate
int selected = list.getSelectionModel().getSelectedIndex();
if (selected >= 0) {
System.out.println("data? " + selected + list.getItems().get(selected));
}
}
});
box.getChildren().add(save);
Implementation intention seems to be to cancel the edit (which would be wrong, because highly unexpected by users), see discussion in
To reproduce, take sample code of
- start edit some row and change its content
- click on the save button
expected: editor removed and edited content committed
is: editor visible, edited content not committed
Button save = new Button("save");
save.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
// actual code would be something like save(list.getItems());
// simulate
int selected = list.getSelectionModel().getSelectedIndex();
if (selected >= 0) {
System.out.println("data? " + selected + list.getItems().get(selected));
}
}
});
box.getChildren().add(save);
- relates to
-
JDK-8089514 [TableView, TreeView, ListView, TreeTableView] Clicking outside of the edited cell, node, or entry should commit the value
- Open