Hi there,
I've been struggling with this and I think I might have hit a bug...
I have a DynamicForm which is placed on a Window. Now, when the user submits the form, the window should be destroyed.
When I have this the form submits fine, but the window doesn't close (obviously):
But when I try this the form doesn't validate (I could do that myself of course), it closes the Window eventually BUT I get a weird error message in my console (posted below):
And the error:
Can anyone tell me how to correctly submit the form AND close the window?
Regards,
Kees.
I've been struggling with this and I think I might have hit a bug...
I have a DynamicForm which is placed on a Window. Now, when the user submits the form, the window should be destroyed.
When I have this the form submits fine, but the window doesn't close (obviously):
Code:
final Window winModal = new Window(); winModal.setIsModal(true); final DynamicForm form = new DynamicForm(); form.setDataSource(aDataSource); form.setUseAllDataSourceFields(true); SubmitItem submitButton = new SubmitItem("Save"); form.setItems(submitButton); winModal.addItem(form); winModal.show();
Code:
final Window winModal = new Window(); winModal.setIsModal(true); final DynamicForm form = new DynamicForm(); form.setDataSource(aDataSource); form.setUseAllDataSourceFields(true); ButtonItem submitButton = new ButtonItem("Save"); submitButton .addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() { public void onClick( com.smartgwt.client.widgets.form.fields.events.ClickEvent event) { form.submit(); winModal.destroy(); } }); form.setItems(submitButton); winModal.addItem(form); winModal.show();
Code:
00:00:23,297 [ERROR] Uncaught exception escaped com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot call method '$49z' of null stack: TypeError: Cannot call method '$49z' of null at Object.anonymous (eval at Function) at Object.fireCallback (http://localhost:8888/nl.kees.help.ModuleTest/sc/modules/ISC_Core.js:270:44) at Object.fireCallback (http://localhost:8888/nl.kees.help.ModuleTest/sc/modules/ISC_Core.js:362:60) at Object.$38b (http://localhost:8888/nl.kees.help.ModuleTest/sc/modules/ISC_DataBinding.js:483:14) at Object.processResponse (http://localhost:8888/nl.kees.help.ModuleTest/sc/modules/ISC_DataBinding.js:337:6) at [object Object].<anonymous> (unknown source) at __gwt_jsInvoke (http://localhost:8888/nl.kees.help.ModuleTest/hosted.html?nl_kees_help_ModuleTest:70:35) at eval at eval (native v8natives.js:132:1) at XMLHttpRequest.<anonymous> (unknown source) at unknown source type: non_object_property_call arguments: $49z, __gwt_ObjectId: 187 at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264) 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:188) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) 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:157) at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Thread.java:595)
Can anyone tell me how to correctly submit the form AND close the window?
Regards,
Kees.
Comment