This is my implementation of EditTextCell:
public class MyEditTextCell extends EditTextCell {
@Override
protected void edit(Context context, Element parent, String value) {
if (value.equals("")) {
super.edit(context, parent, value);
} else {
clearViewData(context.getKey());
}
}
}
I would like to text input to be shown for only for empty cells. IT is why I've override the edit() method. The rest behaviour of oryginal EditTextCell is ok, so I've not changed it.
This unfortunatelly doesn't work. Please help.
The editor in
EditTextCellis shown inonBrowserEventmethod, so you just need:Remember, to add the
FieldUpdaterto the column to save the edited value.Here you have a full working example with simple table type containing only one
String:Please, notice that once you edit the cell value to be non-empty, the editor will not be shown after that.