sjivan / gwt-ext

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

form response with file upload: Expected primitive type int; actual value was undefined #414

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add a form, set the form fileUpload to true, add a file upload field.
2. submit the form. the server response is
HTTP/1.1 200 OK
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 65
Date: Tue, 16 Sep 2008 02:36:32 GMT
Server: Apache-Coyote/1.1

{
  "message": "an example failure message",
  "success": false
}
3. Client will give this error in host mode: 

com.google.gwt.dev.shell.HostedModeException: Expected primitive type int;
actual value was undefined
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:51)
    at
com.google.gwt.dev.shell.ie.SwtOleGlue.convertVariantsToObjects(SwtOleGlue.java:
57)
    at
com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:119)
    at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
    at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
    at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
    at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
    at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
    at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
    at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)

This bug is discussed here: 
http://www.viridium.ro/2008/gwt-gwt-ext-and-mimemultipart-forms/
http://gwt-ext.com/forum/viewtopic.php?f=5&t=161&st=0&sk=t&sd=a&hilit=form+submi
t+response

It is different from http://code.google.com/p/gwt-ext/issues/detail?id=267

What version of the product are you using? On what operating system?
I am using the get-ext 2.0.5, gwt 1.5.2, window XP. Someone points out it
only occurs at host mode. 

Please provide any additional information below.
I traced the issue to code  Form.java
 346: status = action.response.status;
If I change the code to 
       status = action.response.status === null || 
        action.response.status === undefined ? 
         status : action.response.status;
as it is for actioncomplete

The FormListener's onActionFailed is called properly.

-jason

Original issue reported on code.google.com by jasonzha...@gmail.com on 16 Sep 2008 at 5:33

GoogleCodeExporter commented 8 years ago
Thanks for the report and fix. This has been a long standing issue. We'll try 
to get
it into the next release.

Original comment by sanjiv.j...@gmail.com on 16 Sep 2008 at 1:05