Hi,

I have a problem using NSNumberFormatter to validate the input of an WOTextField. When e.g. setting formatter.setMinimum(5) and formatter.setMaximum(20) then validationFailedWithException is called for all values <0, >20, and 1-4 but _not_ for 0.

Here are some code snippets:

Constructor:
inputFormatter=new NSNumberFormatter("#");
inputFormatter.setMaximum(new BigDecimal(20));
inputFormatter.setMinimum(new BigDecimal(5));


public void validationFailedWithException(Throwable t, Object value, String keyPath) {
    if( keyPath.equals("value")) {
        warningVisible=true;
    }
    validationError=true;
    super.validationFailedWithException(t, value, keyPath);
}
        
public WOActionResults saveSettings() {
    if( validationError) {
        validationError=false;
        return null;
    }
    return pageWithName("Main");
}

The html code looks like this:

<wo:textfield value="$value" formatter="$inputFormatter" />


Am I missing something?

Thanks!

Regards,
Oliver
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to