Here is my test case:
I'm now seeing this error:
Code:
private ListGrid grid; public void onModuleLoad() { HLayout layout = new HLayout(); layout.setWidth(300); layout.setHeight(200); layout.setMembersMargin(20); grid = new ListGrid(); ListGridRecord record1 = new ListGridRecord(); record1.setAttribute("one", "1"); record1.setAttribute("two", "1"); record1.setAttribute("three", "1"); ListGridRecord record2 = new ListGridRecord(); record2.setAttribute("one", "2"); record2.setAttribute("two", "2"); record2.setAttribute("three", "2"); ListGridRecord record3 = new ListGridRecord(); record3.setAttribute("one", "3"); record3.setAttribute("two", "3"); record3.setAttribute("three", "3"); ListGridRecord[] records = new ListGridRecord[3]; records[0] = record1; records[1] = record2; records[2] = record3; ListGridField field0 = new ListGridField("Select"); field0.setType(ListGridFieldType.BOOLEAN); field0.setCanEdit(Boolean.TRUE); field0.setCanToggle(Boolean.TRUE); field0.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { GWT.log("col:" + event.getColNum() + " row:" + event.getRowNum(), null); } }); ListGridField field1 = new ListGridField("one", "one"); ListGridField field2 = new ListGridField("two", "two"); ListGridField field3 = new ListGridField("three", "three"); ListGridField[] fields = new ListGridField[4]; fields[0] = field0; fields[1] = field1; fields[2] = field2; fields[3] = field3; grid.setAutoFetchData(Boolean.FALSE); grid.setEditEvent(ListGridEditEvent.NONE); grid.setAutoSaveEdits(Boolean.FALSE); grid.setFields(fields); grid.setData(records); layout.addMember(grid); DynamicForm df = new DynamicForm(); CheckboxItem check = new CheckboxItem("checkbox1", "Check"); df.setItems(check); layout.addMember(df); layout.draw(); }
I'm now seeing this error:
Code:
Uncaught JavaScript exception [java.lang.ClassCastException: com.smartgwt.client.widgets.grid.ListGridField cannot be cast to com.smartgwt.client.widgets.grid.ListGrid Uncaught JavaScript exception [java.lang.ClassCastException: com.smartgwt.client.widgets.grid.ListGridField cannot be cast to com.smartgwt.client.widgets.grid.ListGrid at com.smartgwt.client.widgets.grid.events.ChangedEvent.getEventColumn(ChangedEvent.java:153) at com.smartgwt.client.widgets.grid.events.ChangedEvent.getColNum(Native Method) at com.smartgwt.client.widgets.grid.events.ChangedEvent.getColNum(Native Method) at org.yournamehere.client.MainEntryPoint$1.onChanged(MainEntryPoint.java:124) at com.smartgwt.client.widgets.grid.events.ChangedEvent.dispatch(ChangedEvent.java:97) at com.smartgwt.client.widgets.grid.events.ChangedEvent.dispatch(ChangedEvent.java:1) at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65) at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53) at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178) at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:237)] in http://localhost:8084/WebApplication1/org.yournamehere.Main/hosted.html?org_yournamehere_Main, line 8
Comment