为什么我会得到一个JavascriptException;没有方法';焦点'&引用;当我点击EditTextCell时?

为什么我会得到一个JavascriptException;没有方法';焦点'&引用;当我点击EditTextCell时?,java,gwt,user-interface,Java,Gwt,User Interface,我在用GWT做桌子 我希望其中一个字段是EditTextCell。它最初呈现OK,但当我单击它将其更改为TextInputCell时,我在Eclipse中看到以下异常: 15:13:22.428 [ERROR] [xxx] Uncaught exception escaped com.google.gwt.core.client.JavaScriptException: (TypeError): Object [object Text] has no method 'focus' at com

我在用GWT做桌子

我希望其中一个字段是EditTextCell。它最初呈现OK,但当我单击它将其更改为TextInputCell时,我在Eclipse中看到以下异常:

15:13:22.428 [ERROR] [xxx] Uncaught exception escaped

com.google.gwt.core.client.JavaScriptException: (TypeError): Object [object Text] has no method 'focus'
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
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.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
at sun.reflect.GeneratedMethodAccessor252.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
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.reactToMessages(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:680)
有关守则如下:

private void buildTable() {
  // Create a celltable
  final CellTable<Person> personTable = new CellTable<Person>(KEY_PROVIDER);
  // Create name column
  final EditTextCell nameCell = new EditTextCell();
  Column<Person, String> nameColumn = new Column<Person, String>(nameCell) {
    @Override
    public String getValue(Person person) {
      return person.getName();
    }
  };
  nameColumn.setFieldUpdater(new FieldUpdater<Person,String>() {
    public void update(int index, Person object, String value) {
      System.out.println("field updater called");
    }
  });
  // Make the name column sortable.
  nameColumn.setSortable(true);
  personTable.addColumn(nameColumn, "Name");
  // ... and then code for other columns... 
}
private void buildTable(){
//创建一个单元格表
final CellTable personTable=新的CellTable(键提供程序);
//创建名称列
最终EditTextCell nameCell=新的EditTextCell();
Column nameColumn=新列(nameCell){
@凌驾
公共字符串getValue(个人){
返回person.getName();
}
};
nameColumn.setFieldUpdater(新的FieldUpdater(){
公共void更新(int索引、Person对象、字符串值){
System.out.println(“调用的字段更新程序”);
}
});
//使名称列可排序。
nameColumn.setSortable(true);
addColumn(nameColumn,“Name”);
//…然后为其他列编写代码。。。
}

有人知道我为什么会看到这个异常吗

我不知道这一特定错误的原因是什么,但我也受到了这个问题的困扰

我能够使用一个数据提供者来解决这个问题,在我的例子中,更具体地说,是一个AsyncDataProvider。但是,您可以在示例中使用ListDataProvider。有关数据提供程序的更多信息,请访问

您可能需要检查,并检查示例java代码