Reputation: 21
I am using GWT MVP II (with the UiBinder) and I have a question. Let's say I have a widget, which consist of:
CoolButtonView.ui.xml - xml for UiBinder
CoolButtonView.java - view's interface
CoolButtonViewImp.java - implements the CoolButtonView.java and contains a reference into CoolButtonPresenter
CoolButtonPresenter.java - presenter's interface
CoolButtonPresenterImpl.java - implement the CoolButtonPresenter and contains a reference into CoolButtonView
I am trying to use it inside the other widgets xml via an interface like this: < r:CoolButtonView ui:field="myButton" />, but I am getting an error:
Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
Not allowed in an HTML context Element
<r:CoolButtonView ui:field='CoolButtonView' />
However if I use my widget via the view, everything is good: < r:CoolButtonViewImpl ui:field="myButton" /> But I think that this isn't correct.
Should I use an interface inside the xml-files? And if I should, what is a correct way?
Upvotes: 0
Views: 84
Reputation: 64541
It should work, but your @UiField
should be provided=true
.
See https://code.google.com/p/google-web-toolkit/issues/detail?id=5662 and https://code.google.com/p/google-web-toolkit/issues/detail?id=5879
Whether you should or should not do it is another story that “will likely solicit debate, arguments, polling, or extended discussion” and StackOverflow is not the place for such questions: see https://stackoverflow.com/faq#close
Upvotes: 1