• 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
Re: WOTextField with double value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOTextField with double value


  • Subject: Re: WOTextField with double value
  • From: Gustavo Adolfo Pizano <email@hidden>
  • Date: Wed, 10 Jun 2009 13:46:35 +0200

Hello again.

I was trying settting up a formatter, but I dunno what Im doign wrong..
I have the following:
<wo:WOTextField value = "$price" numberformat = "$doubleFormater"/></span>
and in the java file:

doubleFormater = new NSNumberFormatter("#,##0.00");
/**
* @return the price
*/
public Number price() {
return price;
}
/**
* @param price the price to set
*/
public void setPrice(Number price) {
this.price = price.doubleValue();
}

but  I get then the following excetion:


Jun 10 13:38:56 LocXManager[59322] WARN NSLog - <er.ajax.AjaxRequestHandler>: Exception occurred while handling request:
java.lang.ClassCastException: com.webobjects.foundation.NSNumberFormatter
[2009-6-10 13:38:56 CEST] <WorkerThread0> java.lang.ClassCastException: com.webobjects.foundation.NSNumberFormatter
at er.extensions.components._private.ERXWOTextField.takeValuesFromRequest(ERXWOTextField.java:99)
at com.webobjects.appserver._private.WODynamicGroup.takeChildrenValuesFromRequest(WODynamicGroup.java:84)
at er.ajax.AjaxDynamicElement.takeValuesFromRequest(AjaxDynamicElement.java:125)
at er.ajax.AjaxUpdateContainer.takeValuesFromRequest(AjaxUpdateContainer.java:52)
at com.webobjects.appserver._private.WODynamicGroup.takeChildrenValuesFromRequest(WODynamicGroup.java:84)
at com.webobjects.appserver._private.WODynamicGroup.takeValuesFromRequest(WODynamicGroup.java:93)
at er.extensions.components._private.ERXWOForm.takeValuesFromRequest(ERXWOForm.java:299)
at com.webobjects.appserver._private.WODynamicGroup.takeChildrenValuesFromRequest(WODynamicGroup.java:84)
at com.webobjects.appserver._private.WODynamicGroup.takeValuesFromRequest(WODynamicGroup.java:93)
at com.webobjects.appserver.WOComponent.takeValuesFromRequest(WOComponent.java:1051)
at com.webobjects.appserver.WOSession.takeValuesFromRequest(WOSession.java:1331)
at er.extensions.appserver.ERXSession.takeValuesFromRequest(ERXSession.java:529)
...
...



so I dunno how to do that binding to a double,.. without setting instead a binding to a string and the parsing the string into the double... I mean is it possible?

thx

Gustavo



On Jun 10, 2009, at 10:15 AM, Gustavo Adolfo Pizano wrote:

Hello I have some WOTextField which the value is a double, in the accessors methods should I bind it to a NSNumber?, or use a numberFormatter.. which in case I dunno how to specify it,... I saw in the documentation how to specify a NSFormatter with a date but for the numberFormatter, in my case a double,.. how I specify the formatter?

If I bind the WOTExtFields to a double only, I get an exception. and it tells me that this often happens when no formatter has been specified.

where am I wrong?


Thx

Gustavo


 _______________________________________________
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: WOTextField with double value
      • From: Andrew Lindesay <email@hidden>
References: 
 >WOTextField with double value (From: Gustavo Adolfo Pizano <email@hidden>)

  • Prev by Date: Re: WOWODC - a few pics
  • Next by Date: Re: WOTextField with double value
  • Previous by thread: WOTextField with double value
  • Next by thread: Re: WOTextField with double value
  • Index(es):
    • Date
    • Thread