• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSNumberFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumberFormatter


  • Subject: NSNumberFormatter
  • From: Ingenieurbüro Birnfeld - Oliver Birnfeld <email@hidden>
  • Date: Fri, 12 Jul 2013 14:21:23 +0200
  • Organization: Ingenieurbüro Birnfeld

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSNumberFormatter
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Where has WebObjects543.dmg gone?
  • Next by Date: Create dynamic AjaxTabbedPanelTab in AjaxTabbedPanel with WORepetion
  • Previous by thread: Re: Where has WebObjects543.dmg gone?
  • Next by thread: Re: NSNumberFormatter
  • Index(es):
    • Date
    • Thread