I wasted a lot of time trying to make Basic Grid work. I use this versions of libraries:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>com.extjs</groupId>
<artifactId>gxt</artifactId>
<version>2.2.0</version>
</dependency>
I makes all by this example: http://zawoad.blogspot.com/2009/08/how-to-create-simple-grid-using-gxtext.html In moduleOnLoad I wrote this:
@Override
public void onModuleLoad() {
User admin = new User();
admin.setLogin("Admin");
admin.set("login", "admin");
List<User> users = Arrays.asList(admin);
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig loginColumn = new ColumnConfig("login", "Login", 100);
configs.add(loginColumn);
ListStore<User> listStore = new ListStore<User>();
listStore.add(users);
ColumnModel cm = new ColumnModel(configs);
Grid<User> grid = new Grid<User>(listStore, cm);
grid.setStyleAttribute("borderTop", "none");
grid.setAutoExpandColumn("login");
grid.setBorders(true);
grid.setStripeRows(true);
RootPanel.get().add(grid);
RootPanel.get().add(grid);
}
But I got following exception:
onModuleLoad() threw an exception
Exception while loading module com.XXXX.client.TaskGWTEntryPoint. See Development Mode for details.
java.lang.reflect.InvocationTargetException
......
Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.extjs.gxt.ui.client.widget.grid.GridTemplates' (did you forget to inherit a required module?)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
at com.google.gwt.core.shared.GWT.create(GWT.java:57)
at com.google.gwt.core.client.GWT.create(GWT.java:85)
at com.extjs.gxt.ui.client.widget.grid.GridView.initTemplates(GridView.java:1343)
at com.extjs.gxt.ui.client.widget.grid.GridView.init(GridView.java:1211)
at com.extjs.gxt.ui.client.widget.grid.Grid.onRender(Grid.java:863)
at com.extjs.gxt.ui.client.widget.Component.render(Component.java:1003)
at com.extjs.gxt.ui.client.widget.Component.onAttach(Component.java:1617)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:475)
at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:127)
at com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:97)
at com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:97)
at
com.XXXX.client.TaskGWTEntryPoint.onModuleLoad(TaskGWTEntryPoint.java:42)
... 9 more
Caused by: java.lang.IncompatibleClassChangeError: Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected
at com.extjs.gxt.ui.rebind.core.TemplatesGenerator$SourceGenerator.validateType(TemplatesGener ator.java:142)
What module is required? This is present in my *.gwt.xml:
<inherits name='com.extjs.gxt.ui.GXT'/>
Why my basic grid did not work? Thanks for you answers
It looks like a duplicate of Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected for which there is a great answer.
Basically you should upgrade to the latest versions...