Hi all,
I have following code:
After changing the value of cbId form field and clicking at validate button twice appears exception popup window and in logs I see:
Looks to me as a bug. I spent really a lot of time to reproduce it with a simple example.
Workarounds found:
If only validator or only handler is used - works
If this field isn't connected to any datasource - works
If instead of DynamicForm is SearchForm used - works
SmartGWT version: 2.5.2011-03-31-EVAL
Browsers: IE7, FF 3.6.16
Cheers,
Alexey
I have following code:
Code:
public class MySearchPanel extends ShowcasePanel { private DynamicForm form; ... public Canvas getViewPanel() { form = new DynamicForm(); form.setDataSource(...); MaskValidator validator = new MaskValidator(); validator.setMask("^\\s*(.*?)\\s*$"); validator.setTransformTo("$1"); FormItem cbId = new FormItem("cbId"); cbId.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { System.out.println("cbId - changed handler"); } }); cbId.setValidators(validator); form.setFields(cbId); VLayout layout = new VLayout(); layout.addMember(form); IButton myButton = new IButton("validate"); myButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { form.validate(); } }); layout.addMember(myButton); return layout; } }
Code:
16:38:46.076 [ERROR] [showcase] Uncaught exception escaped com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:214) at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103) at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101) at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:66) 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:597) 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.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129) 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:214) at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:662) Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): _3.replace is not a function fileName: http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Forms.js?isc_version=8.0.js lineNumber: 1653 stack: ([object Object],[object Object],233,[object Object])@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Forms.js?isc_version=8.0.js:1653 isc_c_Validator_processValidator([object Object],[object Object],233,"mask",[object Object])@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Forms.js?isc_version=8.0.js:1687 isc_Canvas_validateField([object Object],[object Array],233,[object Object],[object Object])@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Core.js?isc_version=8.0.js:3764 isc_DynamicForm_validate()@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Forms.js?isc_version=8.0.js:575 ()@http://127.0.0.1:8080:1102 @:0 ([object GWTJavaObject],1179847,[object GWTJavaObject])@http://127.0.0.1:8080/wep/showcase/hosted.html?showcase:56 ([object Object],(void 0))@http://127.0.0.1:8080:1151 ((function () {var param = {};var event = __gwt_makeJavaInvoke(1)(null, 2687095, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);var ret = __gwt_makeJavaInvoke(0)(event, 1310726);return !ret;}),[object Object],[object Object])@http://127.0.0.1:8080:34 @:0 (null,106,(function () {var param = {};var event = __gwt_makeJavaInvoke(1)(null, 2687095, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);var ret = __gwt_makeJavaInvoke(0)(event, 1310726);return !ret;}),[object Object],[object Object])@http://127.0.0.1:8080/wep/showcase/hosted.html?showcase:56 ([object Object],(void 0))@http://127.0.0.1:8080:47 ([object Object],(void 0))@http://127.0.0.1:8080:13 isc_StatefulCanvas_handleActivate([object Object],(void 0))@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Foundation.js?isc_version=8.0.js:321 isc_StatefulCanvas_handleClick([object Object],(void 0))@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Foundation.js?isc_version=8.0.js:323 isc_c_EventHandler_bubbleEvent([object Object],"click")@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Core.js?isc_version=8.0.js:1573 isc_c_EventHandler_handleClick([object Object])@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Core.js?isc_version=8.0.js:1421 isc_c_EventHandler__handleMouseUp([object MouseEvent],(void 0))@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Core.js?isc_version=8.0.js:1408 isc_c_EventHandler_handleMouseUp([object MouseEvent])@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Core.js?isc_version=8.0.js:1399 isc_c_EventHandler_dispatch(isc_c_EventHandler_handleMouseUp,[object MouseEvent])@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Core.js?isc_version=8.0.js:1636 anonymous([object MouseEvent])@http://127.0.0.1:8080/wep/showcase/sc/modules/ISC_Core.js?isc_version=8.0.js:63 at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeBoolean(ModuleSpace.java:184) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeBoolean(JavaScriptHost.java:35) at com.smartgwt.client.widgets.form.DynamicForm.validate(DynamicForm.java) at com.wirecard.gwt.wep.client.card.chargeback.search.ChargebackSearchPanel$4.onClick(ChargebackSearchPanel.java:96) at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:99) at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1) at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:204) at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103) at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101) at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:66) 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:597) 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.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129) 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:214) at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:662)
Workarounds found:
If only validator or only handler is used - works
If this field isn't connected to any datasource - works
If instead of DynamicForm is SearchForm used - works
SmartGWT version: 2.5.2011-03-31-EVAL
Browsers: IE7, FF 3.6.16
Cheers,
Alexey
Comment