我有这段代码,用于使用 FlexTable 在网格布局中呈现产品:
@Override
public void onSuccess(Map<Long, Product> mp) {
int i = 0;
int j = 0;
GWT.log("Success list all products count="+mp.size());
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());
flextable.setWidget(i, j, pw);
i = j > 3 ? i : i++;
j++;
it.remove(); // avoids a ConcurrentModificationException
}
}
Map
mp 返回4
要呈现为小部件的产品,但仅3
在 Flextable 上呈现,此代码可能有什么问题?