GWT formpanel does not call onSubmitComplete
gwt, java, servlets
Solution
I know this is an old question, but I was just having the same problem and none of these answers were the solution. After calling `FormPanel.submit()`, the response would open in a new tab and `onSubmitComplete()` would not be called.
The solution ended up being that my `FormPanel` was not added to my dialog which called `submit()`. Since the form consists entirely of `Hidden` fields, whose values are set depending on the button on the page that is pressed, my `FormPanel` doesn't actually contain any form widgets with user selectable values, so I didn't have the need to add it to the window anywhere.
This is what was causing the response to open in a new window and `onSubmitComplete()` not being called. I added it to the panel for my `DialogBox` and after that it worked as it should.
Problem
GWT: I can call the servlet in browser. When I call it by formpanel, it can call onSubmit. But it does not call onSubmitComplete. It wil also popup a new window, the uri is my servlet. ``` String URL= GWT.getModuleBaseURL()+"getType"; FormPanel formPanel = new FormPanel(); formPanel.setAction(URL); formPanel.setEncoding(FormPanel.ENCODING_URLENCODED); formPanel.setMethod(FormPanel.METHOD_GET); formPanel.addSubmitHandler(new SubmitHandler(){ @Override public void onSubmit(SubmitEvent event) { // TODO Auto-generated method stub System.out.println(event.getSource()); } }); formPanel.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() { public void onSubmitComplete(SubmitCompleteEvent event) { System.out.println("in"); System.out.println(event.getResults()); } }); formPanel.submit(); GWT.xml <servlet class="msp2.server.getType" path="/getType" /> web.xml <servlet > <servlet-name>getType</servlet-name> <servlet-class>msp2.server.getType</servlet-class> </servlet> <servlet-mapping> <servlet-name>getType</servlet-name> <url-pattern>/msp2_app/getType</url-pattern> </servlet-mapping> ```