kostas trichas
kostas trichas

Reputation: 3013

GXT (EXT-GWT) Default Grid Widget implementation. What's wrong?

Sample Code for Grid

public class GraduateProject implements EntryPoint {

    public static List<Student> getStudents() {
        List<Student> students = new ArrayList<Student>();
        students.add(new Student("Kostas", "Trichas"));
        students.add(new Student("Dimitris", "Elotriviaris"));
        students.add(new Student("Dimitris", "Moutafidis"));
        students.add(new Student("Stavros", "Baltas"));
        students.add(new Student("Panos", "Paikos"));
        students.add(new Student("Nikos", "Antarakis"));
        students.add(new Student("Vagelis", "Papaiakos"));
        return students;
    }

    @Override
    public void onModuleLoad() {

        List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

        ColumnConfig column = new ColumnConfig();
        column.setId("fname");  
        column.setHeader("First Name");
        column.setWidth(250);
        configs.add(column);

        column = new ColumnConfig();
        column.setId("lname");  
        column.setHeader("Last Name");
        column.setWidth(250);
        configs.add(column);

        ListStore<Student> studentList = new ListStore<Student>();
        studentList.add(getStudents());

        ColumnModel cm = new ColumnModel(configs);

        final Grid<Student> grid = new Grid<Student>(studentList,cm);
        RootPanel.get().add(grid);
    }

}

And the error:

onModuleLoad() threw an exception

Exception while loading module com.graduateproject.client.GraduateProject. See Development Mode for details. java.lang.reflect.InvocationTargetException 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:183) 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) 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.client.GWT.create(GWT.java:98) at com.extjs.gxt.ui.client.widget.grid.GridView.initTemplates(GridView.java:1351) at com.extjs.gxt.ui.client.widget.grid.GridView.init(GridView.java:1224) at com.extjs.gxt.ui.client.widget.grid.Grid.onRender(Grid.java:880) at com.extjs.gxt.ui.client.widget.Component.render(Component.java:1022) at com.extjs.gxt.ui.client.widget.Component.onAttach(Component.java:1636) at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:449) 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.graduateproject.client.GraduateProject.onModuleLoad(GraduateProject.java:58) ... 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(TemplatesGenerator.java:142) at com.extjs.gxt.ui.rebind.core.TemplatesGenerator$SourceGenerator.generate(TemplatesGenerator.java:97) at com.extjs.gxt.ui.rebind.core.TemplatesGenerator.generate(TemplatesGenerator.java:56) at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48) at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60) at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:662) at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41) at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74) at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:259) at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141) at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585) at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455) at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) ... 20 more

Upvotes: 0

Views: 4753

Answers (1)

kostas trichas
kostas trichas

Reputation: 3013

I figured it out myself. There is an incompatibility between the latest GWT 2.2.0 SDK and the standard EXT-GWT version 2.2.1. I switched back the GWT version to the previous release 2.0.4 and everything works fine. I hope EXT-GWT will soon update it's SDK to catch up with GWT.

Upvotes: 1

Related Questions