Eclipse 3.7 GWT 2.4 当我使用 xml 创建模板化 UiBinder 类时,我在
@UiField SpanElement nameSpan 上看到了问题;
“字段nameSpan在模板文件Login.ui.xml中没有对应的字段”
怎么修?
登录.java
public class Login extends UIObject {
private static LoginUiBinder uiBinder = GWT.create(LoginUiBinder.class);
interface LoginUiBinder extends UiBinder<Element, Login> {
}
@UiField
SpanElement nameSpan;
public Login(String firstName) {
setElement(uiBinder.createAndBindUi(this));
nameSpan.setInnerText(firstName);
}
}
登录.ui.xml
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
<div>
Hello,
<span ui:field='nameSpan' />
</div>
</ui:UiBin