Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java uibinder onload not调用_Java_Gwt_Uibinder - Fatal编程技术网

Java uibinder onload not调用

Java uibinder onload not调用,java,gwt,uibinder,Java,Gwt,Uibinder,如果我通过newthewidget()调用uibinderis onLoad()方法是否在小部件()实例化后立即调用 public class TheWidget extends Composite { } 在我的测试中,onLoad()不是调用当小部件连接到浏览器文档时,而不是在构建它时,onLoad被调用 尝试将您的小部件添加到另一个附加的小部件: TheWidget theWidget = new TheWidget(); RootPanel.get().add(theWidget);

如果我通过
newthewidget()调用uibinder
is onLoad()方法是否在小部件()实例化后立即调用

public class TheWidget extends Composite {

}

在我的测试中,onLoad()不是调用

当小部件连接到浏览器文档时,而不是在构建它时,onLoad被调用

尝试将您的小部件添加到另一个附加的小部件:

TheWidget theWidget = new TheWidget();
RootPanel.get().add(theWidget);

当您的小部件连接到浏览器文档时,而不是在构建它时,会调用onLoad

尝试将您的小部件添加到另一个附加的小部件:

TheWidget theWidget = new TheWidget();
RootPanel.get().add(theWidget);

若您在
复合
对象内部使用UiBinder,那个么您应该在构建对象时调用它-在构造函数内部。看看。

如果您在
复合对象中使用UiBinder,那么您应该在构建对象时调用它-在构造函数中。请看下面的图片