Number display problem in TextField!

Hi,

I’m having problems with validating a number with a TextField component!

I’ve defined an ObjectProperty like this:

ObjectProperty<Integer> myVar = new ObjectProperty<Integer>(1234); 

The validation looks like: myFld.addValidator(new IntegerRangeValidator( "The number must be between 1920 and 2020 (was {0})!", 1920, 2020)); myFld.setImmediate(true); The validation works fine but the field displays the entered number with a comma as grouping seperator (e.g. 1,925)!

But I want to get rid of the grouping seperator all together and tried something like:

DecimalFormat df = new DecimalFormat(); df.setGroupingUsed(false); but don’t know how to implement this!

Any hint on this would be very helpful. Thanks in advance!

Regards,
Gerard

Hello, you must try NumberField component.! https://vaadin.com/directory#addon/numberfield-vaadin-7 .

Hi,

Well, yes, I considered that too, but I’d rather use no add-ons in my basic GUI. Just to be less dependent, sorry!

Regards,
Gerard