On Thursday, October 11, 2007, 8:06:47 PM, Francisco <[EMAIL PROTECTED]> wrote:

> Hi, I am using Apache Wicket 1.3.0-beta2 and want to have a nonzero positive
> validator, a nonzero negative, and a nonzero positive or negative.

> I saw that wicket comes with the NumberValidator.minimum maximun etc.
> Will there be more validators added to the framework?
> Is there a stuff project or smaller project in which to contribute?
> Could I have these validators without implementing my own?

You could supply a patch to NumberValidator, but they're not really
complex, e.g.

    /**
     * Validator to check the number is greater than zero 
     */
    public class PositiveLongValidator extends AbstractValidator {
        protected void onValidate(IValidatable validatable) {
            final long value = ((Number) validatable.getValue()).longValue();
            if (!(value > 0)) {
                error(validatable);
            }
        }
    }

/Gwyn


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to