Typeahead for numeric column, cannot get rid of commas

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Typeahead for numeric column, cannot get rid of commas

Postby dfrazier » Thu Dec 13, 2012 6:41 pm

I am having a problem with a typeahead element that is used to select values from an integer column in my database. For the display format of the typeahead field, I have used "#" (without the quotes obviously). This makes it so numbers larger than 3 digits do NOT have a comma when shown in the field. So the number "5,749" would show up as "5749". That is how I want it. However, the typeahead always wants to show the numbers with commas when they are shown in the dropdown list of suggestions. This is a problem because if the user selects one of the numbers from the typeahead suggestions list, that number will be entered into the field with the comma. If you enter a number into that field and it has a comma, it is instantly reverted back to the field's old value (because the format is not valid I figure). So basically, there is no way to select anything in my typeahead.

So I tried putting "#" in the edit format too. I figured if the display format matched the edit format, that would fix it. Nope. The typeahead continues to display the commas. The only way I can make my typeahead actually accept data is to remove my "#" format and just accept the commas. If I do that, it works ok. I don't want commas!!

Is this a bug? Am I doing something incorrect?
Attachments
Screenshot of number field.png
Here I am typing in the number, and you see the suggestion has the comma in it. If I pick the suggestion, it will enter it into the field for a split second, then revert back to whatever was in the field before.
Screenshot of number field.png (3.62 KiB) Viewed 2895 times
This is my signature.
User avatar
dfrazier
 
Posts: 40
Joined: Fri Jun 29, 2012 3:43 pm
Location: Earth

Re: Typeahead for numeric column, cannot get rid of commas

Postby tgs » Fri Dec 14, 2012 10:19 am

How are your locale settings for locale.integerformat: in servoy-admin?
I have had a similar problem and could fix it with making the locale setting on the server.
Have you tried this?


Regards
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: Typeahead for numeric column, cannot get rid of commas

Postby dfrazier » Fri Dec 14, 2012 6:26 pm

I went ahead and stuck a "#" in the locale.integerformat as you suggested and that fixed the problem. So that is an acceptable workaround for now. Thanks for the tip!!
This is my signature.
User avatar
dfrazier
 
Posts: 40
Joined: Fri Jun 29, 2012 3:43 pm
Location: Earth

Re: Typeahead for numeric column, cannot get rid of commas

Postby lvostinar » Tue Jan 15, 2013 11:20 am

dfrazier wrote:I went ahead and stuck a "#" in the locale.integerformat as you suggested and that fixed the problem. So that is an acceptable workaround for now. Thanks for the tip!!


Fixed this for 6.1.4, so that format set on field also works.
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am


Return to Web Development

Who is online

Users browsing this forum: No registered users and 4 guests