You want to put all of your logic into the presenter without putting
any of the widget code in that would prevent tests from running.
For the ListBox you want to declare a ChangeHandler on it in the
Presenter. To do that you have the View return back the ListBox as an
interface of HasChangeHandler.
@UiHandler ListBox fooItems;
public HasChangeHandler getHasChangeHandler() {
return fooItems;
}
You will also have to have the View return back the selected item
since I don't see any interfaces you can return to do that.
public String getItem() {
return fooItems.getItemText(fooItems.getSelectedIndex());
}
Finally the view can return back the TextBox has a HasEnabled
interface so the presenter can disable it.
@UiBinder TextBox textBox;
public HasEnabled getHasEnabled() {
return textBox;
}
Now the presenter can call these to get the item when selected and
disable the text box if needed.
view.getHasChangeHandler().addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
view.getItem();
view.getHasEnabled().setEnabled(false);
}
}
);
> Im a bit confused as in what does UI handling is meant inhttp://
code.google.com/webtoolkit/articles/mvp-architecture.html, which is