I need a customized TextArea component, where I'd like disable some keys (f.e. backspace and del keys). For this I created a vaadin-archetype-widget artifact, and I created two subclasses (MyTextArea and VMyTextArea), and I overrode the onKeyDown method in class VMyTextArea:
@Override
public void onKeyDown(KeyDownEvent event) {
int kc = event.getNativeKeyCode();
if (kc == KeyCodes.KEY_BACKSPACE || kc == KeyCodes.KEY_DELETE) {
return;
}
super.onKeyDown(event);
}
Unfortunately this solution doesn't solve my problem, the backspace and delete keys work normally. My question how to do this?