我正在尝试使用已实现ListBox
的HasValue
接口,我从以下链接获得了代码/想法,并制作了自己的列表框类
http://turbomanage.wordpress.com/2010/04/01/selectonelistbox-for-use-with-gwtmvp/
现在的问题是我@UiTemplate
在我的视图中使用,我发现很难转换ListBox
到这个新的ListBox
.
我的视图类代码:
// defines List Box , so it get attached with UiTemplate
@UiField ListBox countryListBox ;
//-- this function should get the list box, i call this in presenter...
//-- now the problem is i do not know how i take this listbox back as selectOneListBox
public HasSelectedValue <T> getCountry() {
// TODO Auto-generated method stub
//return desTextBox;
SelectOneListBox<T> sel = new SelectOneListBox<T>(null);
sel =(SelectOneListBox<T>) countryListBox;
//return (SelectOneListBox<T>) countryListBox;
return sel;
//return countryListBox ;
}