I have the following code:
public class A extends Composite {
public String url;
public String result;
public A(String url, String result) {
this.url = url;
this.result = result;
}
public A someObject;
public VerticalPanel vp = new VerticalPanel();
public void init() {
someObject = new A(url, result);
someObject.setStyleName("style");
this.vp.add(someObject);
}
But when I call ‘this.vp.add(…)’ it says:
(TypeError): Cannot read property '__gwt_resolve' of null
How can that be??
Your
Compositewidget is missing a call toinitWidget(). If it were aWidgetit would probably be missing a call tosetElement().See https://developers.google.com/web-toolkit/doc/latest/DevGuideUiCustomWidgets