I have CellTable with password as one column. I want the password column to be editable.
My code is something like follows
public class EditPasswordTextCell extends EditTextCell {
@Override
protected void edit(Context context, Element parent, String value) {
setValue(context, parent, value);
InputElement input = getInputElement(parent);
input.setAttribute("type", "password"); //$NON-NLS-1$ //$NON-NLS-2$
input.focus();
input.select();
}
}
This brings up a password box when clicking on the cell. But after finished editing and the value shown in the column is in plain text. Then i decided to override the renderer methods. But most of the methods in EditTextCell class are private, so i ended up overriding
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
value = "******"; //$NON-NLS-1$
super.render(context, value, sb);
}
The above code works fine for first rendering and not for the subsequent.
Now the question arises, should i extend from EditTextCell or AbstractEditableCell?