Question

I'm trying my hand at the new GWT 2.0 UIBinder capability, and I have a ui XML that looks like this:

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:my='urn:import:com.mystuff.mypackage'>
<g:VerticalPanel>
      <!-- other stuff -->
  <my:FileUploadPanel.ValidatingFileUpload styleName="field" ui:field="fileUpload" />
</g:VerticalPanel>

ValidatingFileUpload is a non-static inner class contained in FileUploadPanel that extends the FileUpload GWT class. It has an explicit zero-arg constructor that simply calls super(). However, when GWT starts up, I get this error:

00:00:18.359 [ERROR] Rebind result 'com.mystuff.mypackage.FileUploadPanel.ValidatingFileUpload' has no default (zero argument) constructors.
java.lang.NoSuchMethodException: com.mystuff.mypackage.FileUploadPanel$ValidatingFileUpload.<init>()

Any idea what might be going wrong here?

Was it helpful?

Solution

A non-static inner class needs to be instantiated within an instance of its containing class. This prohibits UiBinder from instantiating it when needed. Try using a static nested class instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top