You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by V SANTOSH PAVAN RAJU Bs <pa...@gmail.com> on 2012/02/10 14:56:43 UTC

Question regarding TextInput

Hi,

I had a question regarding TextInput, can we make sure that a TextInput
allows only numeric values?

-- 
Thanks & Regards
B.S.V.S.Pavan Raju.
Skype: skype_pavan1
Hyderabad.

Re: Question regarding TextInput

Posted by Sandro Martini <sa...@gmail.com>.
Hi,
you have to set a Validator in your Component (and maybe after this,
set the strict validation mode, depending on your requirements).

As a sample, try lo look at TextInputValidatorTest (under the tests subproject):
in TextInput textinputDateRegex
you then set
        // validate using a date regex.
        textinputDateRegex.setText("2009-09-01");
        textinputDateRegex.setValidator(new RegexTextValidator(
            "(19|20)\\d\\d[- /.](0[1-9]|1[012])[-/.](0[1-9]|[12][0-9]|3[01])"));

or you can implement your own Validators.


Bye