google-code-export / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 0 forks source link

NumberField.getValue() throws JavaScript exception in hosted mode #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
com.google.gwt.dev.shell.HostedModeException:
invokeNativeFloat(@com.gwtext.client.widgets.form.NumberField::getValue()):
JS value of type string, expected float
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:149)
    at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeFloat(ModuleSpace.java:217)
    at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeFloat(JavaScriptHost.java:81
)
    at com.gwtext.client.widgets.form.NumberField.getValue(NumberField.java:41)
    at
ec.ep.sdw.visep.web.client.ui.VisitRequestDialog$24.validate(VisitRequestDialog.
java:305)

Client side code:

return numSponsoredParticipants.getValue() <= 0L ||
numParticipants.getValue() >= 20L;

Original issue reported on code.google.com by mathias....@gmail.com on 22 Aug 2007 at 4:52

GoogleCodeExporter commented 9 years ago
That error is raised when the number field is empty and Ext returns "". I think 
I'm
go  with your previous suggestion of returning java.lang.Number for the method
getValue() so that way null can be returned if the NumberField is empty. Will 
update
this issue when the change is made.

Original comment by gwt....@gmail.com on 22 Aug 2007 at 6:08

GoogleCodeExporter commented 9 years ago
NumberField#getValue now returns java.lang.Number. null is returned for empty 
field
values. Note that in Ext 1.1 final, a value of 0 is returned as null. This will 
be
fixed in the bug fix release of Ext 1.1.

Original comment by sanjiv.j...@gmail.com on 29 Aug 2007 at 2:57

GoogleCodeExporter commented 9 years ago
fyi the bug where a value of 0 is returned as null with NumberField has been 
fixed in
Ext 1.1.1

Original comment by sanjiv.j...@gmail.com on 5 Sep 2007 at 3:08

GoogleCodeExporter commented 9 years ago
Please refer to the test case attached. It cause ClassCastException.

Original comment by ashleywong1015 on 19 Oct 2007 at 10:38

Attachments:

GoogleCodeExporter commented 9 years ago
This was due to a bug introduced in Ext 1.1.1. See details here :
http://extjs.com/forum/showthread.php?t=15738

I've incorporated a workaround. Please test against a new build.

Thanks,
Sanjiv

Original comment by sanjiv.j...@gmail.com on 19 Oct 2007 at 1:29