I am using SmartClient Version: SC_SNAPSHOT-2011-12-16/LGPL Development Only (built 2011-12-16)
Gwt 2.4.0
Problem occurs on Firefox 6.0.2, Chrome 16.0.912.77 m, IE 8.0.6001.18702 on Windows XP SP3
I am trying to check if there is any criteria entered by user in filterEditor with RelativeDateItem and with advanced criteria enabled.
I have problem with method Criteria.getValues().
Steps to reproduce error:
1. With empty filterEditor user clicks filter button (some data is loaded from server) there is no error with method call
2. User choose some date in RelativeDateItem, then clicks filter button (some data is loaded from server) there is no error with method call
3. User clears RelativeDateItem, then clicks filter button again
4. Java script error occurs
errors comes from Criteria.getValues()
in developer console there is only:
and I think is not related to my problem
Standalone test case:
entry point class:
data source code:
Gwt 2.4.0
Problem occurs on Firefox 6.0.2, Chrome 16.0.912.77 m, IE 8.0.6001.18702 on Windows XP SP3
I am trying to check if there is any criteria entered by user in filterEditor with RelativeDateItem and with advanced criteria enabled.
I have problem with method Criteria.getValues().
Steps to reproduce error:
1. With empty filterEditor user clicks filter button (some data is loaded from server) there is no error with method call
2. User choose some date in RelativeDateItem, then clicks filter button (some data is loaded from server) there is no error with method call
3. User clears RelativeDateItem, then clicks filter button again
4. Java script error occurs
Code:
19:35:44.688 [ERROR] [filtereditorexception] 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.HandlerManager.fireEvent(HandlerManager.java:129) at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) 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.GeneratedMethodAccessor111.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) 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(Thread.java:722) Caused by: java.lang.IllegalArgumentException: convertToMap - unable to convert JavaScript object passed in to a Mapnull at com.smartgwt.client.util.JSOHelper.convertToMap(JSOHelper.java:501) at com.smartgwt.client.util.JSOHelper.convertToMap(JSOHelper.java:513) at com.smartgwt.client.data.Criteria.getValues(Criteria.java:118) at pl.com.intuicja.client.FilterEditorException$3.onFilterEditorSubmit(FilterEditorException.java:74) at com.smartgwt.client.widgets.grid.events.FilterEditorSubmitEvent.dispatch(FilterEditorSubmitEvent.java:96) at com.smartgwt.client.widgets.grid.events.FilterEditorSubmitEvent.dispatch(FilterEditorSubmitEvent.java:1) at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1) at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40) at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193) at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88) at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127) at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) 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.GeneratedMethodAccessor111.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) 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(Thread.java:722)
in developer console there is only:
Code:
19:25:22.149:RDQ4:WARN:DynamicForm:isc_RelativeDateItem_0_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:25:22.154:RDQ4:WARN:DynamicForm:isc_RelativeDateItem_1_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:25:22.158:RDQ4:WARN:DynamicForm:isc_RelativeDateItem_0_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:25:22.160:RDQ4:WARN:DynamicForm:isc_RelativeDateItem_1_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:25:27.823:RDQ9:WARN:DynamicForm:isc_RelativeDateItem_0_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:25:27.828:RDQ9:WARN:DynamicForm:isc_RelativeDateItem_1_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:25:27.831:RDQ9:WARN:DynamicForm:isc_RelativeDateItem_0_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:25:27.834:RDQ9:WARN:DynamicForm:isc_RelativeDateItem_1_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:51:38.348:RDQ2:WARN:DynamicForm:isc_RelativeDateItem_0_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:51:38.353:RDQ2:WARN:DynamicForm:isc_RelativeDateItem_1_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:51:38.356:RDQ2:WARN:DynamicForm:isc_RelativeDateItem_0_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:51:38.359:RDQ2:WARN:DynamicForm:isc_RelativeDateItem_1_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:51:45.837:RDQ6:WARN:DynamicForm:isc_RelativeDateItem_0_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:51:45.843:RDQ6:WARN:DynamicForm:isc_RelativeDateItem_1_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:51:45.847:RDQ6:WARN:DynamicForm:isc_RelativeDateItem_0_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace] 19:51:45.851:RDQ6:WARN:DynamicForm:isc_RelativeDateItem_1_editor:ignoring bad or negative width: -4 [enable 'sizing' log for stack trace]
Standalone test case:
entry point class:
Code:
public class FilterEditorException implements EntryPoint { private VLayout vlTlo = new VLayout(); private ListGrid lgSomeData = new ListGrid(); private ListGridField lgfImie= new ListGridField("imie", "Imię"); private ListGridField lgfNazwisko = new ListGridField("nazwisko", "Nazwisko"); private ListGridField lgfDataUr = new ListGridField("dataUr", "Data Urodzenia"); private DynamicForm frmSomeDataActions = new DynamicForm(); ButtonItem btnShowSgwtVer = new ButtonItem("btnShowSgwtVer", "ShowVer"); public void onModuleLoad() { DateUtil.setShortDatetimeDisplayFormatter(new DateDisplayFormatter() { @Override public String format(Date date) { DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); return dtf.format(date); } }); DateUtil.setDateInputFormat("YMD"); if (!GWT.isScript()) { KeyIdentifier debugKey = new KeyIdentifier(); // debugKey.setAltKey(true); debugKey.setCtrlKey(true); // debugKey.setAltKey(true); debugKey.setKeyName("M"); Page.registerKey(debugKey, new KeyCallback() { public void execute(String keyName) { SC.showConsole(); } }); } lgSomeData.setShowFilterEditor(true); lgfImie.setWidth("25%"); lgfNazwisko.setWidth("50%"); lgfDataUr.setWidth("*"); lgSomeData.setFields(lgfImie, lgfNazwisko, lgfDataUr); lgSomeData.addFilterEditorSubmitHandler(new FilterEditorSubmitHandler() { @Override public void onFilterEditorSubmit(FilterEditorSubmitEvent event) { Criteria crit = event.getCriteria(); Map<String, Object> critMap = crit.getValues(); //here error occurs } }); lgSomeData.addSelectionUpdatedHandler(new SelectionUpdatedHandler() { @Override public void onSelectionUpdated(SelectionUpdatedEvent event) { frmSomeDataActions.editSelectedData(lgSomeData); } }); lgSomeData.setDataSource(SomeDataDS.getInstance()); frmSomeDataActions.setDataSource(SomeDataDS.getInstance()); frmSomeDataActions.setFields(btnShowSgwtVer); frmSomeDataActions.setUseAllDataSourceFields(true); btnShowSgwtVer.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { SC.say("Sgwt Ver: " + Version.getVersion() + " " + DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(Version.getBuildDate())); } }); vlTlo.setSize("100%", "100%"); vlTlo.addMember(lgSomeData); vlTlo.addMember(frmSomeDataActions); vlTlo.draw(); } }
Code:
public class SomeDataDS extends RestDataSource { private static SomeDataDS ds; public static SomeDataDS getInstance(){ if (ds == null){ ds = new SomeDataDS("SomeDataDS"); } return ds; } public SomeDataDS (String id){ setID(id); setDataFormat(DSDataFormat.XML); setDataProtocol(DSProtocol.POSTXML); setDataURL(GWT.getModuleBaseURL() + "SomeData.Service"); OperationBinding addOB = new OperationBinding(); addOB.setOperationType(DSOperationType.ADD); OperationBinding updateOB = new OperationBinding(); updateOB.setOperationType(DSOperationType.UPDATE); OperationBinding removeOB= new OperationBinding(); removeOB.setOperationType(DSOperationType.REMOVE); OperationBinding fetchOB= new OperationBinding(); fetchOB.setOperationType(DSOperationType.FETCH); setOperationBindings(fetchOB,addOB,removeOB,updateOB); DataSourceIntegerField dsifIdSomeData = new DataSourceIntegerField("idSomeData", "id"); dsifIdSomeData.setPrimaryKey(true); dsifIdSomeData.setRequired(true); dsifIdSomeData.setHidden(true); DataSourceTextField dstfImie = new DataSourceTextField("imie", "Imię"); DataSourceTextField dstfNazwisko= new DataSourceTextField("nazwisko", "Nazwisko"); DataSourceDateTimeField dsdtfDataUr = new DataSourceDateTimeField("dataUr", "Data Urodzenia"); setFields(dsifIdSomeData, dstfImie, dstfNazwisko, dsdtfDataUr); setWillHandleAdvancedCriteria(true); } }
Comment