When i want to edit a textinputcell, i generally need two clicks : the first click gives focus to the cell and then to the input.
I have a celltable with 20 columns, all textinputcell – excel style. And this problem makes it totally unusable.
Here’s a code sample :
FieldUpdater<MyBean, String> fieldUpdater = new FieldUpdater<MyBean, String>() {
@Override
public void update(int index, MyBean object, String value) {
object.setValue(value);
}
};
Column<MyBean, String> column = new Column<MyBean, String>(new TextInputCell()) {
@Override
public String getValue(MyBean object) {
return objet.getValue();
}
};
column.setFieldUpdater(fieldUpdater);
table.addColumn(column, "Col");
Did you have to face the problem ? Is there a know solution ?
Thanks
Allright, here’s what i did : I noticed the EditTextCell doesn’t take two clicks to change focus
So i duplicated the class (everything’s private :/) and i made the following change in the method render :
Before :
After :
I’m only using the template and never the renderer.
Bonus :
Since you’re using your own copy of the cell, you can edit the template. I added a width (constructor arg) :
And i call the template like this :
sb.append(template.input(text, width));Hope that helps 🙂