Create a custom textfield

I need to create one textfield that masks a text when my user input something, so I create one textedit and add a ValueChangeEvent, but when I run in an weak computer every request to back take times and if my user insert a lot of number very quick I got problem, so can I create one event that works in client side? and only when finish he send a finished masked text to my back?

Yes, it sounds doable on the client side. Keep track of the real content in memory, write mask to text field whenever the user presses a key and send the real content to server on field blur event. You can get started on that with keydown listeners on the text field, but you will need to cover some corner cases you might not immediately think of:

  • pasting values
  • removing values with backspace / delete
  • moving cursor with keyboard / mouse, so the next input character (or deletion) doesn’t come last

-Olli