【问题标题】:Node cannot be inserted at the specified point in the hierarchy[GWT]无法在层次结构中的指定点插入节点[GWT]
【发布时间】:2014-04-23 12:42:00
【问题描述】:

我创建了类似的类

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

}

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

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)]): 无法在层次结构中的指定点插入节点

【问题讨论】:

    标签: java javascript gwt


    【解决方案1】:

    问题可能出在下面一行:

    this.add(this);
    

    你不能自己添加组件。

    【讨论】:

      猜你喜欢
      • 2010-09-25
      • 2012-05-31
      • 2010-11-10
      • 2012-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多