Undesired TextField behavior when validator attached

I have a simple form that takes telephone number information, in particular a form that takes range of numbers and generates phone numbers.

The form fields are just TextFields that are backed by String objects (i.e. via a custom object wrapped in a container).

So to insure that these fields are entered correctly I’ve added simple validators(i.e extend Validator and simply uses the regex (“\d{3}”) to validate the field in this case a 3 digit value.

The fields are set to immediate, and whenever I type in leading zeros they are trimmed. When I remove the validator the textfield behaves normally.

Anyone know why?

Thanks.
Matt

Ending up removing the validator and implemented the validation differently. I’m guessing no one else has seen this?

If the fields are backed by Strings, this should not happen - and in general, having validators should not affect the value.

Could you
create a bug report
about this with a short snippet of code with which this can be reproduced?

Thanks for the reply, how do I get a trac account? at the time I was on an pre
6.4
6.6.4 version of vaadin too so it’s possible the bug is no longer reproducible.

You need to click on register in the top right of the track page and make a separate account for it.