gpt4 book ai didi

java - 无法在层次结构中的指定点插入节点[GWT]

转载 作者:太空宇宙 更新时间:2023-11-04 06:51:36 28 4
gpt4 key购买 nike

我创建了这样的类

public class FinalizeEvalutionReportPanel extends VerticalPanel{

//other code...

public class PopupPanel extends DialogBox
{
public PopupPanel() {
this.setStyleName("gwt-DialogBoxNew");
this.setText(WorkFlowUtil.getPropertyValue(propertyKeys.showAgreement));
this.setWidth(StringUtil.getWidthByGivenPercentage(30)+"px");
this.add(this);
this.center();
addHandler();
}
private void addHandler() {
final DialogBox box=this;
giveFeedbackBtn.addClickHandler(new ClickHandler() {

@Override
public void onClick(ClickEvent event) {
box.hide();
}
});
}
}

}

我尝试在单击按钮时从其他类(class)调用它。

showAgreementBtn.addClickHandler(new ClickHandler() {

@Override
public void onClick(ClickEvent event) {
new FinalizeEvalutionReportPanel().showPopUp();//this give Java Script error

}
});

我收到此错误...

com.google.gwt.core.client.JavaScriptException: (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR) @com.google.gwt.dom.client.Node::appendChild(Lcom/google/gwt/dom/client/Node;)([JavaScript object(7280)]): Node cannot be inserted at the specified point in the hierarchy

最佳答案

问题可能出在下面一行:

this.add(this);

您无法添加组件本身。

关于java - 无法在层次结构中的指定点插入节点[GWT],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23244629/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com