NullPointerException when initializing GWT’s UiBinder widget
I have a simple Composite that uses UiBinder. GWT was crashing on the following line:
public StartView() {
initWidget(uiBinder.createAndBindUi(this)); // NullPointerException
}
StartView.ui.xml:
<g:VerticalPanel>
<g:HorizontalPanel>
<comp:FloorPicker />
<g:HTMLPanel ui:field="gamePanel" />
<comp:BuildMenu />
</g:HorizontalPanel>
<comp:FriendsPlaying />
</g:VerticalPanel>
The composites in comp were ones I had defined myself. They were simply empty composites:
public class FriendsPlaying extends Composite { }
Apparently GWT doesn’t like this. Solution: fill them out with the UiBinder boilerplate, and everything will work fine.
1 Notes/ Hide
-
publishingexc liked this
-
wtfnth posted this