Hello again.
I was trying settting up a formatter, but I dunno what Im doign wrong..
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();
}
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?
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