Hi Carlos, I would be very much interested in the code! Best regards,
Arne Von: Carlos Lobato [mailto:[email protected]] Gesendet: Mittwoch, 4. Januar 2012 19:18 An: [email protected] Betreff: Re: NumberField validation Hi, 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. Regards, -Carlos On Tue, Jan 3, 2012 at 11:38 PM, Bob Schellink <[email protected]<mailto:[email protected]>> wrote: Hi, On Wed, Jan 4, 2012 at 12:49 AM, Carlos Lobato <[email protected]<mailto:[email protected]>> 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
