How to add the listbox items using UiBinder?
GWT ValueListbox otherwise know as a ComboBox or Dropdown component. Another example that also demonstrates populating the list.
UiBinder...
Editor...
@UiField(provided = true)
ValueListBox subCategory = new ValueListBox(
new Renderer() {
@Override
public String render(String object) {
String s = "Cats";
if (object != null) {
s = object.toString();
}
return s;
}
@Override
public void render(String object, Appendable appendable)
throws IOException {
render(object);
}
});
Constructor...
List values = new ArrayList();
values.add("Animal Shelters and Rescues");
values.add("Birds");
values.add("Cats");
values.add("Dogs");
values.add("Other Pets");
values.add("Rabbits");
subCategory.setAcceptableValues(values);