Threaded View

  1. #1
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    340
    Vote Rating
    15
    Answers
    14
    icfantv will become famous soon enough

      0  

    Question Answered: Setting max length on TextField

    Answered: Setting max length on TextField


    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?

  2. There is a way to set max length on a textfield.it passes the test to me.
    like this:

    public class MyTextField extends TextField {

    public MyTextField(){
    InputElement ie=this.getInputEl().cast();
    ie.setMaxLength(10);
    }


    }