我需要實現「分頁」我的應用程序的FlexTable部件:尋呼FlexTable與GWT
這是我在那裏呈現一個產品成3列單元格初始代碼:
public void renderProducts(Map<Long, Product> mp) {
int i = 0;
int j = 0;
Iterator it = mp.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry)it.next();
Product product = (Product) pairs.getValue();
ProductWidget pw = productInstance.get();
pw.setTitle(product.getName());
pw.setImageUrl(product.getImageUrl());
pw.setContent(product.getInfo());
pw.setUrl(product.getUrl()); // "More" button anchor
List<String> feats = product.getFeatures();
for (String f : feats){
pw.addFeature(f);
}
flextable.setWidget(i, j, pw);
j++;
if (j == 3){
i++;
j = 0;
}
it.remove(); // avoids a ConcurrentModificationException
}
}
極品爲此在N個頁面中進行分頁。我最初的想法是將地圖拆分爲地圖列表...
我的意思是,FlexTable中是否有任何「數據源」?
你有一個模型,需要分頁,那麼爲什麼不CellTable/DataGrid的?只是問問。 – 2013-03-19 12:36:22
我需要將一個小部件插入到可伸縮的「單元」中,請參閱:flextable.setWidget(...) 您有任何建議嗎? – xybrek 2013-03-19 12:53:24