Formatting on text filed

Questions and answers for designing and implementing forms in Servoy

Formatting on text filed

Postby nisalaperera » Tue Jul 15, 2014 12:16 pm

Hi All,

I need to implement following scenario for a text-field which is connected with a text column (char[11]).

Input layout should be XXXXXX XXXXX, i.e. a blank after 6 characters, but only in the field format, does not get stored in the data field. Allowed characters are A-Z and 0-9 only. If we could manage capital letters only, then it would be better.

Could we handle this using format property? If yes, how is it?

Or is there another way to handle it in servoy?

Please have a look on attached screen-shot. I have no-idea and I couldn't find any resource that explaining the attached popup.
edit_text_format_property.png
edit_text_format_property.png (51.25 KiB) Viewed 2490 times
Regards
Nisala Perera
Returnpool Lanka Pvt Ltd.
nisalaperera
 
Posts: 16
Joined: Fri Sep 12, 2008 6:23 am

Re: Formatting on text filed

Postby jcompagner » Thu Oct 23, 2014 12:37 pm

formatexample.png
formatexample.png (21.5 KiB) Viewed 2268 times


why not something like this? so with A (only alpha numeric)
and raw value (so you only store the actual 11 chars)

and then with a ui converter that just does this:

Code: Select all
/**
* Called for performing a conversion between a displayed value and a database value.
*
* @param {String} displayedValue The displayed value.
* @param {String} dbType The type of the database column. Can be one of "TEXT", "INTEGER", "NUMBER", "DATETIME" or "MEDIA".
*
* @returns {Object} the database value.
*
* @properties={typeid:24,uuid:"56EE5E8A-F886-4A92-B6EE-383DE9250E4F"}
*/
function globalConverterObj2DB(displayedValue, dbType) {
   return displayedValue.toUpperCase();
}
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests