我有以下情況。我的UI表單上有兩個組合,一個顯示蔬菜列表,另一個顯示水果列表。GWT @UiFactory和參數化返回類型
在我的支持視圖類,我想宣佈這樣的方法:
@UiFactory
SimpleComboBox<Vegetable> createVegetablesCombo() {
return vegetables;
}
@UiFactory
SimpleComboBox<Fruit> createFruitsCombo() {
return fruits;
}
但似乎GWT不能識別參數返回類型......每次我得到一個錯誤:
ERROR: Duplicate factory in class VegetablesAndFruitsView for type SimpleComboBox.
可以處理這種情況嗎?一個UI表單上有多個組合框的好例子嗎?