Is there really no way to set the max length on a text field? I know I can use a max length validator but that doesn't prevent the user from entering more characters than is "allowed."
There was a setMaxLength(...) in 2.x on the TextField object. Why was it pulled in favor of a validator?
An obvious solution would be to set the maxlength attribute on the underlying input element, but I wasn't sure how to do it.
I found a solution in a blog post: http://www.selikoff.net/2011/04/26/g...tfield-in-gxt/
Yes, that is an obvious solution indeed. :-) How to actually get to the DOM element is the tricky part.
Thanks for that post. The solution I thought of (but was dreading) was something we had to do back in my Java Swing days which was to add a key up listener to the field and when the limit was hit, stop allowing input. But it's annoying because you still have to allow for the backspace and delete keys.