基本网格不起作用

奥列克桑德·H

我浪费了很多时间尝试使Basic Grid正常工作。我使用以下版本的库:

    <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>

我让所有的例子:http://zawoad.blogspot.com/2009/08/how-to-create-simple-grid-using-gxtext.html在moduleOnLoad我写了这个:

@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);
}

但是我得到以下异常:

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)

需要什么模块?这存在于我的* .gwt.xml中:<inherits name='com.extjs.gxt.ui.GXT'/>

为什么我的基本网格不起作用?谢谢你的回答

och

它看起来像Found接口com.google.gwt.core.ext.typeinfo.JClassType的重复,但是期望有一个很好的答案的类。

基本上,您应该升级到最新版本...

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章