Each time TextFieldTableColumn.updateItem() is invoked (e. g. as "super" call in decorating successor implementations) it clears the graphic node! This is very annoying, as e. g. designers like to use CSS to set an icon, or decorating successor implementations like to get the automatic convertion from TextFieldTableColumn but want to set pseudo states, which lead to CSS-set icons in turn.
A simple workaround is to restore the graphic...
final Node graphic = this.getGraphic();
super.updateItem(value, empty);
this.setGraphic(graphic);
(note: certainly only working if graphic is set programmatically -- NOT working with CSS-set graphic!)
...but this is really ugly. Simply spoken, the following code line in TextFieldTableColumn should get changed from clearing the graphic...
/** {@inheritDoc} */
@Override public void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
CellUtils.updateItem(this, getConverter(), null, null, textField);
}
...to restoring the graphic...
/** {@inheritDoc} */
@Override public void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
CellUtils.updateItem(this, getConverter(), null, getGraphic(), textField);
}
It would be really nice if this would get fixed soon, as it is a totally bad thing that code tweaks in the controller are needed to make purely CSS-designed icons work with TextFieldTableField! :-)
A simple workaround is to restore the graphic...
final Node graphic = this.getGraphic();
super.updateItem(value, empty);
this.setGraphic(graphic);
(note: certainly only working if graphic is set programmatically -- NOT working with CSS-set graphic!)
...but this is really ugly. Simply spoken, the following code line in TextFieldTableColumn should get changed from clearing the graphic...
/** {@inheritDoc} */
@Override public void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
CellUtils.updateItem(this, getConverter(), null, null, textField);
}
...to restoring the graphic...
/** {@inheritDoc} */
@Override public void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
CellUtils.updateItem(this, getConverter(), null, getGraphic(), textField);
}
It would be really nice if this would get fixed soon, as it is a totally bad thing that code tweaks in the controller are needed to make purely CSS-designed icons work with TextFieldTableField! :-)