Re: Using formatters/Entering numbers
Re: Using formatters/Entering numbers
- Subject: Re: Using formatters/Entering numbers
- From: Giorgio Valoti <email@hidden>
- Date: Thu, 9 Oct 2003 09:01:32 +0200
On Mercoledl, ott 8, 2003, at 15:08 Europe/Rome, Dale Stanbrough wrote:
Hi all,
I've got a text field that I have bound to a Number object. When I
enter a numeric value
into the field I get the following message...
While trying to set the field "age" on an object of type Main we
expected a java.lang.Number but received a java.lang.String with a
value of 45. This often happens if you forget to use a formatter.
I'm not quite sure how to use a formatter. I put in "###" and "##0"
directly into the formatter field
for the text field, as well as creating a key numberFormatter of type
NSNumberFormatter, binding
it to the formatter attribute of the text field, and setting it via...
numberFormatter.setFormat("##0");
in the constructor for the component.
Clearly all of these are wrong, so I'm not sure where to go now.
Either you set the formatter pattern or a formatter object. Most of the
times binding the numberFormat is enough unless you have some special
needs, say custom thousand delimiter or things like that.
HTH
--
Giorgio Valoti
-------------
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.