juliano
juliano

Reputation: 45

GWT uiBinder works with inheritence?

I have a base class for a CRUD form to my models. In the template of this class i have a save button.

In the extended class i have many fields relative to the specific model, but not the save button.

Every time i call createAndBindUi in the child model, a error throws that i don't have a save button.

Anyone knows how to do this correctly? Can post the solution.

Upvotes: 3

Views: 2234

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64541

If you need to use UiBinder in both the superclass and the subclass, then you have a design issue. Use composition over inheritance and that'll also solve your UiBinder issues.

There are hacks/workarounds though, but the idea is always to not use the same object as the subject for 2 UiBinder templates.

There are plenty of discussions on UiBinder and inheritance on the GWT forum (not that much on SO though): https://groups.google.com/d/searchin/google-web-toolkit/uibinder%20inheritance

Upvotes: 7

Related Questions