-
Bug
-
Resolution: Not an Issue
-
P3
-
9
-
x86
-
other
FULL PRODUCT VERSION :
java version "9"
Java(TM) SE Runtime Environment (build 9+180)
Java HotSpot(TM) 64-Bit Server VM (build 9+180, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 10.0.15063]
A DESCRIPTION OF THE PROBLEM :
In package javafx.scene.control in the class TableCell
we found (here /..../ replace not pertinent code for the problem) :
@Override public void commitEdit(T newValue) {
/...../
super.commitEdit(newValue);
/...../
if (table != null) {
// reset the editing cell on the TableView
table.edit(-1, null);
/...../
}
}
In this method, the line super.commitEdit(newValue) calls in class javafx.scene.control.Cell the following method :
public void commitEdit(T newValue) {
if (isEditing()) {
setEditing(false);
}
}
Doing so, isEditing is set to false,
It follows that later, when commitEdit executes table.edit(-1, null) nothing happens as
the in class javafx.scene.control.TableView the following edit method
public void edit(int row, TableColumn<S,?> column) {
if (!isEditable() || (column != null && ! column.isEditable())) {
return;
}
if (row < 0 && column == null) {
setEditingCell(null);
} else {
setEditingCell(new TablePosition<>(this, row, column));
}
}
does !isEditable which is always true, preventing the later call to setEditingCell(null)
REGRESSION. Last worked in version 8u131
ADDITIONAL REGRESSION INFORMATION:
n/a sorry
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
build a table (1 column, 1 field) with setOnKeyPressed such as
textField.setOnKeyPressed((KeyEvent t) -> {
if (t.getCode() == KeyCode.ENTER) {
commitEdit(textField.getText());
}
});
edit that field and hit ENTER
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
edit(-1, null) should do setEditingCell(null)
changing the cell editing state to not-editing
ACTUAL -
edit(-1, null) is not called
the cell stay in editing mode active...
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public void commitEdit(String newValue) {
super.commitEdit(newValue);
/* my code here */
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
public void commitEdit(String newValue) {
super.commitEdit(newValue);
// the 3 lines are a patch
getTableView().setEditable(true);
getTableView().edit(-1, null);
getTableView().setEditable(false);
/* my code here */
}
java version "9"
Java(TM) SE Runtime Environment (build 9+180)
Java HotSpot(TM) 64-Bit Server VM (build 9+180, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 10.0.15063]
A DESCRIPTION OF THE PROBLEM :
In package javafx.scene.control in the class TableCell
we found (here /..../ replace not pertinent code for the problem) :
@Override public void commitEdit(T newValue) {
/...../
super.commitEdit(newValue);
/...../
if (table != null) {
// reset the editing cell on the TableView
table.edit(-1, null);
/...../
}
}
In this method, the line super.commitEdit(newValue) calls in class javafx.scene.control.Cell the following method :
public void commitEdit(T newValue) {
if (isEditing()) {
setEditing(false);
}
}
Doing so, isEditing is set to false,
It follows that later, when commitEdit executes table.edit(-1, null) nothing happens as
the in class javafx.scene.control.TableView the following edit method
public void edit(int row, TableColumn<S,?> column) {
if (!isEditable() || (column != null && ! column.isEditable())) {
return;
}
if (row < 0 && column == null) {
setEditingCell(null);
} else {
setEditingCell(new TablePosition<>(this, row, column));
}
}
does !isEditable which is always true, preventing the later call to setEditingCell(null)
REGRESSION. Last worked in version 8u131
ADDITIONAL REGRESSION INFORMATION:
n/a sorry
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
build a table (1 column, 1 field) with setOnKeyPressed such as
textField.setOnKeyPressed((KeyEvent t) -> {
if (t.getCode() == KeyCode.ENTER) {
commitEdit(textField.getText());
}
});
edit that field and hit ENTER
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
edit(-1, null) should do setEditingCell(null)
changing the cell editing state to not-editing
ACTUAL -
edit(-1, null) is not called
the cell stay in editing mode active...
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public void commitEdit(String newValue) {
super.commitEdit(newValue);
/* my code here */
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
public void commitEdit(String newValue) {
super.commitEdit(newValue);
// the 3 lines are a patch
getTableView().setEditable(true);
getTableView().edit(-1, null);
getTableView().setEditable(false);
/* my code here */
}