For a field that has mixed case letters that are changed to uppercase using toUpperCase, is there a way to create a method that will revert the text in the field back to mixed case? Something like toOriginalCase.
and how will that function know how the text was originally “mixed”? I guess you need to store the original value in order to revert to it…
Patricks suggetions is one. But there are more. Maybe it is a good idea to explain what you want to do.
e.g. When you need this for display purposes you can use the mask/formatting property of a field.
From the JS Lib/String I used toLowerCase and toUpperCase, but apparently that is saving changes to the back end database.
I need to have lowercase, uppercase and titlecase applied at the interface level only, and let the backend data be saved as it is originally entered.
Use the “format” option on the field to make the text upper, lower or title. You can then use the “raw” flag to ensure the data remains unchanged in the database.
i.e. AAAAA|raw
I must be missing something obvious. The field format options that I see appear to only allow date formatting.
for textfields you can use these now:
Please give an example for making all text in a field uppercase. I am not clear on whether this requires applying a method or typing some characters under the “Format” property of the field. I see that the Help file gives examples for formatting numbers, currencies, dates and times, but I am still not sure how to apply the same approach to a text field.
For converting to all uppercase:
UUUUUUUUUUUUUUUUUUUUUUUUUUUUU|raw
This will display the string as uppercase, but will keep the value as it is in the database.
Thank you. That is working well on fields with displayType of “TEXT_FIELD”, but it does not appear to work on fields set to have a displayType of “TEXT_AREA”. Is there a way to make it work with “TEXT_AREA” fields? If not, is there another alternative?
It will only work on TEXTFIELDS.
Area’s are for large scale text maskformats are in my eyes completly useles for that.
I have a question on this:
If I use “### ### ##|raw” as a formatter, the result is “raw” (everything without the quotes). What I need is digits blocked like xxx xxx xx. Leading zeros are possible, so it is a text field. I have tried “###-###-##|raw”, that returns “raw- -”.
What am I missing?
Thanks!
Patrick
P.S.: Happy new year and a successful 2005 to all!
i think you need 2.2 for this |raw feature…
Please try it with 2.2b1…
I must be missing something but:
if I assign UUU|raw in the format property of a text field
it displays, as expected, uppercase characters BUT also stores the input always in uppercase and I do not think this is the expected behavior
Servoy Developer
Version R2 2.2rc3-build 321
Java version 1.4.2_04-b05 (Windows XP)
Thank you in advance
yes that is the whole point
It forces users to input things in uppercase. It is not just a display thing.
raw only means that literals in the string like: UU,UU|raw (the ,) is not in the final string..
so:
020-2030202 is stored like: 0202030202
got it NOW… thank you very much