Hi,
I created a list of the 4 strings, called setAcceptableValues(list) in the connstructor, but now I get the 4 values in the list, plus a null entry. What am I doing wrong? This is my AddressEditor.java:
public class AddressEditor extends Composite implements Editor<Address>
{
private static AddressEditorUiBinder uiBinder = GWT.create(AddressEditorUiBinder.class);
interface AddressEditorUiBinder extends UiBinder<Widget, AddressEditor>
{
}
@UiField
TextBox street;
@UiField
TextBox city;
@UiField
TextBox zip;
@UiField
ValueListBox<String> state;
public AddressEditor()
{
initWidget(uiBinder.createAndBindUi(this));
List<String> states = new ArrayList<String>();
states.add("Scotland");
states.add("England");
states.add("Wales");
states.add("Ireland");
state.setAcceptableValues(states);
}
@UiFactory
@Ignore
ValueListBox<String> stateInit()
{
return new ValueListBox<String>(new Renderer<String>()
{
@Override
public String render(String object)
{
return object;
}
@Override
public void render(String object, Appendable appendable) throws IOException
{
if(object != null)
{
appendable.append(object);
}
}
});
}
}
I suspect the first render function is being called, but I can't do a null check on it as it needs a return value.
Thanks