0
我無法弄清爲什麼我的render方法沒有被調用。這是我的定製單元格,它將AbstractCell擴展爲最簡單的形式。CellList中的GWT自定義單元格 - render()未被調用
public class FormHistoryCell<T> extends AbstractCell<T> {
@Override
public void render(com.google.gwt.cell.client.Cell.Context context, T value, SafeHtmlBuilder sb) {
System.out.println("Rendering customer cell...");
if (value == null) {
return;
}
}
}
這裏是我的代碼snipet它創建「FormHistoryCell」的實例,並試圖將其添加到CellList。
@UiFactory
CellList<FormHistoryCell> initList() {
FormHistoryCell formHistoryCell = new FormHistoryCell();
CellList historyList = new CellList<FormHistoryCell>(formHistoryCell);
return historyList;
}
我曾嘗試不同的東西,如添加一個構造函數一個字符串參數等構造函數被調用,但渲染方法是沒有的。看看它擴展的Abstract類,似乎render方法在「setValue」方法中被調用,但沒有看到其他自定義單元格擴展中被調用的渲染方法似乎被調用的很好。我確信我在這裏錯過了一些明顯的東西,但無法弄清楚什麼。請幫忙。
我想你需要在CellList中設置一些數據以便渲染被調用 – outellou