0
我想爲我的vaadin表創建自定義列。所有項目都應該有一個帶有複選框的列。爲了擁有這個專欄,我創建了一個瞬變變量,名稱爲「selected」。當表格顯示其列時,table.setTableFieldFactory()
會運行,但「selected」不會顯示在propertyIds列表中。表字段工廠的瞬態變量
table.setTableFieldFactory((container, itemId, propertyId, uiContext) -> {
if("selected".equals(propertyId)) {
CheckBox checkBox = new CheckBox();
checkBox.addValueChangeListener(event -> selectListener((Boolean)event.getProperty().getValue()));
return checkBox;
}
return null;
});
問題是,如何爲瞬態變量創建自定義字段?我應該如何將我的瞬態變量添加到propertyIds的列表中?我究竟做錯了什麼?
你如何創建你的瞬態變量?你有什麼類型的容器?結果是什麼? – Krayo 2014-10-31 09:09:31
其playframework所以我創建它在我的模型與javax.persistence.transient註釋。它是一個JPAContainer,結果是TRUE或FALSE。 – chabeee 2014-10-31 09:28:28
我對JPAContainer不熟悉,但是我發現了一些有趣的頁面:[link1](https://vaadin.com/forum#!/thread/2482838),[link2](http://dev.vaadin.com /票/ 12861)。 – Krayo 2014-10-31 10:16:31