如何在特定对象列表内使用GWT ValueListBox实现编辑器,以下是我的代码:
但是,在进行GWT编译期间,我遇到了以下错误:
...
@UiField(provided = true)
@Path("address.countryCode")
ValueListBox<Country> countries = new ValueListBox<Country>(
new Renderer<Country>() {
@Override
public String render(Country object) {
return object.getCountryName();
}
@Override
public void render(Country object, Appendable appendable)
throws IOException {
render(object);
}
},
new ProvidesKey<Country>() {
@Override
public Object getKey(Country item) {
return item.getCountryCode();
}
});
...
Country 类
public class Country {
private String countryName;
private String countryCode;
}
但是,在进行GWT编译期间,我遇到了以下错误:
Type mismatch: cannot convert from String to Country