Text field - limit the input

Questions and answers for designing and implementing forms in Servoy

Re: Text field - limit the input

Postby stefanoni » Mon Aug 29, 2011 3:25 pm

ROCLASI wrote:Hi Alessandro,

You use the format property for this.

Thank you. So I tried again and lots of new secrets :

Something with Pipe (|) seems to affect the difference in Data Enter and Data Display,
or if I use Stars (*) it seems to control the count of possible typing, even for a variable as
data-provider !

Where can I find a documentation how to use "format". In the wiki I can't find any description
about the meaning of Pipe.

Thank you for help.
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: Text field - limit the input

Postby lwjwillemsen » Mon Aug 29, 2011 4:40 pm

+1

I find it very strange there is no (complete) formatting options (Wiki) documentation after all these years of Servoy existence.
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Text field - limit the input

Postby Harjo » Mon Aug 29, 2011 5:01 pm

Maybe not the answer you want, but In the older 3.5 developer, Volume 1 User guides, there are 10 pages spent on string & date format's.

Paul could you add that to the wiki also? , with all the examples?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Text field - limit the input

Postby jcompagner » Tue Aug 30, 2011 9:48 am

you shouldn't type in directly something in the format property field. (so type the | as the display/edit format separator)
Please use the format editor there, Then you have a legend specifically to the type (string/number/date) what you can use..
And the option to set a edit or display format and so on.
We then generate the right string for you when you fill in that format popup dialog editor.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Text field - limit the input

Postby stefanoni » Tue Aug 30, 2011 12:41 pm

jcompagner wrote:you shouldn't type in directly something in the format property field. (so type the | as the display/edit format separator)
Please use the format editor there, Then you have a legend specifically to the type (string/number/date) what you can use..
And the option to set a edit or display format and so on.
We then generate the right string for you when you fill in that format popup dialog editor.

Thank you, but :?: (maybe I'm to silly ...)

1.) I don't see any "option to set a edit or display format and so on". In Servoy 6 it looks like this (only display, no edit):
Print_Screen_01010.jpg
Print_Screen_01010.jpg (94.97 KiB) Viewed 4072 times


2.) When I enter 3 Stars (*** = anything, but restrict to 3 positions ) it looks during the smartclient-typing like this:
I type only 2 position (for example "a1") of 3 possible positions, and the rest is displayed as *
Print_Screen_01011.jpg
Print_Screen_01011.jpg (2.37 KiB) Viewed 4072 times


3.) When I enter 3 Stars (***) it restrict the User to type more then 3, no mater if the dataprovider is a variable or
not, so the upper discussions: "pure javascript variables (like globals or form) don't have a length." seems to be not
true. Isn't it ?


What I need at the moment is, that the user can type only 3 positions into an empty field (variable as provider) without seeing any " * "
What kind of Format will be the right one ?
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: Text field - limit the input

Postby jcompagner » Tue Aug 30, 2011 2:53 pm

1> This is why you need to use those format property dialogs: A text dataprovider (mask textfield) doesn't have support for edit/display formats, that is only for other Date/Numbers

2> what is exactly the question here?

3> No the variable still can hold much more, only the ui input blocks it. It has nothing to do with the variable itself (in scripting you could set it to much longer values)
So the variable itself doesn't have a limit (other then memory)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Text field - limit the input

Postby stefanoni » Wed Aug 31, 2011 8:06 am

1> "that is only for other Date/Numbers" That's why I was confused and not able to find the "edit formats"
2> How can I suppress the visible Stars (*) during the user is typing it's content
3> Yes, this is clear for me. I was always talking about the "ui input blocks it" limited to a specific count of positions

Thank you Johan, you for help
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: Text field - limit the input

Postby jcompagner » Wed Aug 31, 2011 1:48 pm

2> you can't, a mask expects that you follow that mask, what you can do is also set a column converter on it, that strips again the * out of it.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Previous

Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests

cron