【问题标题】:GWT DOM not workingGWT DOM 不工作
【发布时间】:2013-03-21 09:40:06
【问题描述】:

我想在 GWT

的 TH> 中附加 div
Element tr = DOM.createTR();

DOM.appendChild(thead, tr);
for (int index = 0; index < headers.size(); index++) {
Element th = DOM.createTH();

Element div = DOM.createDiv();

DOM.appendChild(th, div);   // this is not working !
DOM.appendChild(tr, th);

}

我的代码有什么问题吗?

【问题讨论】:

  • 您是如何创建广告的?什么不工作?给出编译时错误?运行时错误?
  • 使用thead = DOM.createElement("thead");我创建了标题...
  • 我想要
  • 在编译时间或运行时间之后,我没有看到任何错误

标签: java javascript gwt


【解决方案1】:

我认为它会给你编译时错误,因为方法 `DOM.appendChild(th, div);'第二个参数应该是包结构的一部分:

com.google.gwt.user.client.Element 

而不是

com.google.gwt.dom.client.Element

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-08
    • 2022-11-23
    相关资源
    最近更新 更多