is there a way to set all content of an TextField to UPPER CASE?
is there a way to set all content of an TextField to UPPER CASE?
Add this property: style:{textTransform: 'uppercase'}"
this doesn't work...
I need an method getValue that return the value as UPPER CASE
for example:
method getValue changed:Code:TextField<String> textField = new TextField<String>(); textField.setUpperCase(true);
Code:public T getValue() { if(t instanceof String) { String s = (String) t; return isUpperCase ? s.toUpperCase() : s; } /.... ..../ }
I dont get the problem here. So implement your own TextField widget or just overwrite the method which u already have mentioned....
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.Code:TextField<String> textField = new TextField<String>(){ @Override public String getValue() { return super.getValue().toUpperCase(); } };
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??
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
set the field to show and return text in Upper Case..Code:textField.setUpperCase(true);
This getValue override the original and check if the field is true to UpperCase
yes = return string upper case
no = default = return the string
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.