|Custom Widget: how to filter keys ? [message #1778197]
||Mon, 11 December 2017 18:42
| Michel R
Registered: April 2015
I need to finely control what is typed in a field, for instance only some specific digits.
I implemented a custom widget, so far it works, but I can't block unauthorized characters before they are displayed in the field, only afterwards in the _onFieldInput method where I can remove them. This result in the character to be displayed, then immediately removed, from the field.
I would like to avoid this, and just block the character before it is displayed. I tried to understand what 'KeyStrokeContext' does but I don't get it, whatever I try doesn't work, the key event is processed by my KeyStrokeContext object but in the end it is always displayed in the field.
What should I do ?
Powered by FUDForum
. Page generated in 0.06981 seconds