Calling an RPC service method in editing.onCancelEdit leads to an exception (tested with Firefox 10, GXT 3.0.1 and 3.0.3). This only occurs when you press the escape key - click on another cell instead and the rpc call returns correctly.
Launch my example and edit the first line/third column ("muh") and press escape instead of return. This leads to a StatusCodeException:
Module:com.google.gwt.user.client.rpc.StatusCodeException: 0 at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:209)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source)
Grid:Code:public void onModuleLoad() { MyGrid grid = new MyGrid(); VerticalLayoutContainer vlc = new VerticalLayoutContainer(); vlc.setPixelSize(600, 250); vlc.add(grid, new VerticalLayoutData(1, 1)); RootPanel.get().add(vlc); }
ServiceImpl:Code:public class MyGrid extends Grid<TestDTO> { static TestProvider prov = GWT.create(TestProvider.class); public static ColumnConfig col1; private static ColumnConfig col2; private static ColumnConfig col3; private final GridInlineEditing<TestDTO> editing; public MyGrid() { super(new ListStore<TestDTO>(prov.oid()), new ColumnModel( getColumnConfigList())); setBorders(true); getView().setColumnLines(true); getView().setStripeRows(true); getView().setColumnLines(true); getStore().add(new TestDTO(1, 3, 1, "muh")); getStore().add(new TestDTO(2, 2, 4, "muh")); editing = new GridInlineEditing<TestDTO>(this); editing.setClicksToEdit(ClicksToEdit.TWO); editing.addEditor(col3, new TextField()); getStore().setAutoCommit(true); editing.addCancelEditHandler(new CancelEditHandler<TestDTO>() { @Override public void onCancelEdit(CancelEditEvent<TestDTO> event) { TestServiceAsync service = (TestServiceAsync) GWT .create(TestService.class); service.foo(new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { caught.printStackTrace(); } @Override public void onSuccess(String result) { System.out.println("everything's shiny"); } }); } }); } private static List<ColumnConfig> getColumnConfigList() { List<ColumnConfig> columnConfigList = new ArrayList<ColumnConfig>(); col1 = new ColumnConfig(prov.att1(), 150, "Column 1"); columnConfigList.add(col1); col2 = new ColumnConfig(prov.att2(), 150, "Column 2"); columnConfigList.add(col2); col3 = new ColumnConfig(prov.att3(), 150, "Column 3"); columnConfigList.add(col3); return columnConfigList; } interface TestProvider extends PropertyAccess<TestDTO> { ModelKeyProvider<TestDTO> oid(); ValueProvider<TestDTO, Integer> att1(); ValueProvider<TestDTO, Integer> att2(); ValueProvider<TestDTO, String> att3(); } public GridInlineEditing<TestDTO> getEditing() { return editing; } }
Code:public class TestServiceImpl extends RemoteServiceServlet implements TestService { public String foo() { return "bar"; } }