I am trying to use a Java interface to discover a list of widgets that
can be applied to a panel for display. I have built a generator that
looks for the implementations of the Java interface and builds a Java
class that can be used to reference that list. An example would be I
have a CommonPanel interface with two implementations one is an
AccountsCommonPanel class and the other is a CustomerCommonPanel
class. An important note is these implementations of the panels sit
in separate projects and are referenced by an OnlineBanking parent
project.
The generator will then build a Java class something like this.
// the CommonPanels interface is another class used
// by the generator but isn't important to the question I am asking.
class CommonPanelsList implements CommonPanels {
private List<CommonPanel> panels = new ArrayList<CommonPanel>();
public CommonPanelsList() {
panels.add(new AccountsCommonPanel());
panels.add(new CustomerCommonPanel());
}
public List<CommonPanel> get() {
return panels;
}
}
This all seems to be working as I had hope except for one minor
twist. The AccountsCommonPanel uses UI Binding the
CustomerCommonPanel doesn't. When the AccountsCommonPanel gets added
to another panel I get the error - java.lang.AssertionError: This
UIObject's element is not set; you may be missing a call to either
Composite.initWidget() or UIObject.setElement().
I do have the following lines in the AccountsCommonPanel -
private static Binder uiBinder = GWT.create(Binder.class);
interface Binder extends UiBinder<Widget, AccountsCommonPanel> {}
with the correct initWidget line in the constructor.
I also have the sub-projects inherited in the OnlineBanking.gwt.xml.
Does anyone have any ideas on what kind of issues I might be hitting
up against? I am concerned I could be seeing a limitation of the
Generators and the UI Binding capability. I am thinking GWT.create on
UIBinder don't work the same way when being referenced through
generated code.
Thanks,
Jas
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.