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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]