Hybrid View

  1. #1
    Ext User
    Join Date
    Jun 2008
    Location
    Brasil
    Posts
    36
    Vote Rating
    0
    rgpinheiro is on a distinguished road

      0  

    Default TextField to UPPERCASE ?

    TextField to UPPERCASE ?


    is there a way to set all content of an TextField to UPPER CASE?

  2. #2
    Ext User
    Join Date
    Jun 2008
    Location
    Brasil
    Posts
    36
    Vote Rating
    0
    rgpinheiro is on a distinguished road

      0  

    Default


    a flag or something like this?

  3. #3
    Sencha User radustefan's Avatar
    Join Date
    May 2008
    Posts
    43
    Vote Rating
    0
    radustefan is on a distinguished road

      0  

    Default


    Add this property: style:{textTransform: 'uppercase'}"

  4. #4
    Ext User
    Join Date
    Jun 2008
    Location
    Brasil
    Posts
    36
    Vote Rating
    0
    rgpinheiro is on a distinguished road

      0  

    Default


    this doesn't work...

    I need an method getValue that return the value as UPPER CASE

    for example:
    Code:
    TextField<String> textField = new TextField<String>();
    textField.setUpperCase(true);
    method getValue changed:
    Code:
    public T getValue() {
             if(t instanceof String) {
                       String s = (String) t;
                       return isUpperCase ? s.toUpperCase() : s;
             }
             /.... ..../
    }

  5. #5
    Ext User
    Join Date
    Oct 2008
    Location
    Warsaw(PL)/Cottbus(GER)
    Posts
    215
    Vote Rating
    0
    EagleEye666666 is on a distinguished road

      0  

    Default


    I dont get the problem here. So implement your own TextField widget or just overwrite the method which u already have mentioned....

    Code:
    TextField<String> textField = new TextField<String>(){
    	@Override
    	public String getValue() {
    		return super.getValue().toUpperCase();
    	}
    };
    btw. in your code i do not know why u are checkin the string? just set it. you want it uppercase so it doesnt matter if it is already.

    and inheriet from the normal one... overwrite the getter or even the setter method with your uppercase stuff or do it your way that u can decide the set a FLAG. This is some function what u can easily set by urself...


    Your post does not clarify what you want to gain exactly ....
    You want to have the Value just set UPPERcase or already the INPUT? so when u are typing thats automaticly UPPERCASE??

  6. #6
    Ext User
    Join Date
    Jun 2008
    Location
    Brasil
    Posts
    36
    Vote Rating
    0
    rgpinheiro is on a distinguished road

      0  

    Default


    thanks man...

    but I alredy know all u talking about...

    I was just wondering if this could be developed... This change will be very useful and very easy!
    Is just an verification!

    Frankly, I don't have time to make this changes... =\

    Im my example

    Code:
    textField.setUpperCase(true);
    set the field to show and return text in Upper Case..
    This getValue override the original and check if the field is true to UpperCase

    yes = return string upper case
    no = default = return the string

  7. #7
    Sencha Premium Member
    Join Date
    Dec 2008
    Location
    Munich, Germany
    Posts
    183
    Vote Rating
    0
    Jose Jeria is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by rgpinheiro View Post
    this doesn't work...
    The following worked fine for me
    Code:
    textField.setStyleAttribute("textTransform", "uppercase");

  8. #8
    Sencha User
    Join Date
    Apr 2010
    Posts
    5
    Vote Rating
    0
    madhavan is on a distinguished road

      0  

    Default


    Quote Originally Posted by radustefan View Post
    Add this property: style:{textTransform: 'uppercase'}"

    can u tell me where to add this ?

  9. #9
    Sencha Premium Member
    Join Date
    Dec 2008
    Location
    Munich, Germany
    Posts
    183
    Vote Rating
    0
    Jose Jeria is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by madhavan View Post
    can u tell me where to add this ?
    See the reply above yours...

  10. #10
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Posts
    45
    Vote Rating
    0
    Selikoff is on a distinguished road

      0  

    Default


    Settings the style attribute did not work for me. The result I would like is that whatever the user types is always shown to them as uppercase.