I am getting this warning on a ListGrid that is set to show the filter editor, and the grid and group summary. It is causing an issue with the field headers as they are disappearing (or partially viewable).
I'm using SmartGWT 2.5 / GWT 2.3 and testing on Firefox 3.6 and Safari 5. I'm attaching a screenshot of the issue as well as my standalone test case.
Edit:
I have also found this forum post which seems to be the same problem http://forums.smartclient.com/showthread.php?t=18202
The second post links to these two issues that were fixed prior to 2.5 http://code.google.com/p/smartgwt/issues/detail?id=608 http://code.google.com/p/smartgwt/issues/detail?id=611
I'm using SmartGWT 2.5 / GWT 2.3 and testing on Firefox 3.6 and Safari 5. I'm attaching a screenshot of the issue as well as my standalone test case.
Edit:
I have also found this forum post which seems to be the same problem http://forums.smartclient.com/showthread.php?t=18202
The second post links to these two issues that were fixed prior to 2.5 http://code.google.com/p/smartgwt/issues/detail?id=608 http://code.google.com/p/smartgwt/issues/detail?id=611
Code:
14:12:30.503 [ERROR] [gwtstandalone] 14:12:30.502:WARN:RecordEditor:isc_ListGrid_0filterEditor:Fields array contains an empty entry com.smartgwt.client.core.JsObject$SGWT_WARN: 14:12:30.502:WARN:RecordEditor:isc_ListGrid_0filterEditor:Fields array contains an empty entry at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167) 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:132) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java) at com.davidb.client.Gwtstandalone.onModuleLoad(Gwtstandalone.java:166) 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.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:193) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:680)
Code:
14:12:30.705 [ERROR] [gwtstandalone] 14:12:30.668:WARN:ListGrid:isc_ListGrid_0_summaryRow:Fields array contains an empty entry com.smartgwt.client.core.JsObject$SGWT_WARN: 14:12:30.668:WARN:ListGrid:isc_ListGrid_0_summaryRow:Fields array contains an empty entry at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167) 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:132) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java) at com.davidb.client.Gwtstandalone.onModuleLoad(Gwtstandalone.java:166) 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.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:193) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:680)
Code:
//listgrid ListGrid listGrid = new ListGrid(); listGrid.setMargin(10); listGrid.setWidth100(); listGrid.setHeight100(); listGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX); listGrid.setSelectOnEdit(false); listGrid.setCanFreezeFields(true); listGrid.setCanMultiSort(true); listGrid.setCanAutoFitFields(true); listGrid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH); listGrid.setCanExpandRecords(true); listGrid.setCanExpandMultipleRecords(true); listGrid.setShowAllRecords(false); listGrid.setAutoFetchData(false); listGrid.setDataFetchMode(FetchMode.LOCAL); listGrid.setCanEdit(true); listGrid.setEditByCell(true); listGrid.setEditEvent(ListGridEditEvent.DOUBLECLICK); listGrid.setGroupStartOpen(GroupStartOpen.NONE); listGrid.setGroupByMaxRecords(Integer.MAX_VALUE); listGrid.setSortField("ID"); listGrid.setSortDirection(SortDirection.ASCENDING); listGrid.setShowGridSummary(true); listGrid.setShowGroupSummary(true); listGrid.setAlternateRecordStyles(false); listGrid.setShowCustomScrollbars(true); listGrid.setLeaveScrollbarGap(true); listGrid.setShowFilterEditor(true); listGrid.setFilterOnKeypress(true); listGrid.setConfirmDiscardEdits(false); listGrid.setConfirmCancelEditing(false); listGrid.setShowSelectedStyle(false); listGrid.setShowRollOver(false); //DS DataSource dataSource = new DataSource(); dataSource.setClientOnly(true); DataSourceField dsIdField = new DataSourceIntegerField("ID"); dsIdField.setPrimaryKey(true); dsIdField.setHidden(true); DataSourceField dsNameField = new DataSourceTextField("NAME"); DataSourceField dsDeptField = new DataSourceTextField("DEPT"); DataSourceField dsSalaryField = new DataSourceTextField("SALARY"); DataSourceField dsDOBField = new DataSourceDateField("DOB"); dataSource.setFields(dsIdField, dsNameField, dsDeptField, dsSalaryField, dsDOBField); listGrid.setDataSource(dataSource); //fields ListGridField idField = new ListGridField("ID", "ID"); idField.setWidth(50); idField.setCanEdit(false); idField.setShowGridSummary(false); idField.setShowGroupSummary(false); idField.setHidden(true); ListGridField nameField = new ListGridField("NAME", "Name"); nameField.setWidth(125); nameField.setCanEdit(false); nameField.setShowGridSummary(true); nameField.setShowGroupSummary(true); nameField.setShowHover(true); ListGridField deptField = new ListGridField("DEPT", "Department"); deptField.setWidth("*"); deptField.setCanEdit(false); deptField.setShowGridSummary(true); deptField.setShowGroupSummary(true); deptField.setShowHover(true); deptField.setSummaryFunction(new SummaryFunction() { @Override public Object getSummaryValue(Record[] records, ListGridField field) { //find distinct departments HashSet<String> depts = new HashSet<String>(); for(Record rec:records) { depts.add(rec.getAttribute(field.getName())); } return depts.size() + " departments"; } }); ListGridField salaryField = new ListGridField("SALARY", "Salary"); salaryField.setWidth(100); salaryField.setAlign(Alignment.CENTER); salaryField.setCanEdit(true); salaryField.setShowGridSummary(true); salaryField.setShowGroupSummary(true); salaryField.setSummaryFunction(new SummaryFunction() { @Override public Object getSummaryValue(Record[] records, ListGridField field) { int total = 0; for(Record rec:records) { total += rec.getAttributeAsInt(field.getName()); } return total + " salary"; } }); ListGridField dobField = new ListGridField("DOB", "Date of Birth"); dobField.setWidth(100); dobField.setAlign(Alignment.LEFT); dobField.setCanEdit(false); dobField.setShowGridSummary(false); dobField.setShowGroupSummary(false); dobField.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME); listGrid.setFields(idField, nameField, deptField, salaryField, dobField); //main layout VLayout mainLayout = new VLayout(); mainLayout.setWidth100(); mainLayout.setHeight100(); mainLayout.addMember(listGrid); mainLayout.draw();
Comment