click-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Lobato <>
Subject Re: NumberField validation
Date Wed, 04 Jan 2012 18:17:43 GMT

Upon comparing the validate method of NumberField, which subclasses
TextField, I realized NumberField's validate overrides TextField's; so I
ended up subclassing NumberField to "LengthNumberField" and merging NF and
TF validate methods in it. In the end, LengthNumberField validates max, min
value and max, min length. If any of you guys want to implement it you can
reply and I'll send you the code (:

Thanks to Bob and everybody else for devoting so much of your time in
answering questions.


On Tue, Jan 3, 2012 at 11:38 PM, Bob Schellink <> wrote:

> Hi,
> On Wed, Jan 4, 2012 at 12:49 AM, Carlos Lobato <> wrote:
> > Hi apache click folks,
> >
> > I have been trying to make my app take a NumberField only if 5 digits are
> > input. With controls like TelephoneField all I have to do is set its
> minimum
> > length to whatever I want it to and the app will display an error if
> > minLength or maxLength aren't met. However, NumberField seems to ignore
> > minimum length, even though the documentation states that there are error
> > messages mapped for NumberFields for min or max length errors.
> NumberField support min and max value, but not min and max length. So
> you can do:
> field.setMaxValue(99);
> > would also like to know what is the proper way to override its validation
> > and do my own thing, because that seems to be another way to accomplish
> > custom validations, right now this field is only validated when it gets
> no
> > input (setRequired).
> You can override the validate() method to do your own validation.
> regards
> Bob

View raw message