Noo*_*oor 16 java gwt click event-handling gwt2
我为它创建了一个ButtonCell和一个列:
ButtonCell previewButton = new ButtonCell();
Column<Auction,String> preview = new Column<Auction,String>(previewButton) {
public String getValue(Auction object) {
return "Preview";
}
};
Run Code Online (Sandbox Code Playgroud)
我现在如何为此ButtonCell添加点击处理程序(例如ClickHandler)?
Jas*_*erk 16
在细胞取样例子包括使用可点击ButtonCells的.点击ButtonCells是通过为Column 设置FieldUpdater来处理的:
preview.setFieldUpdater(new FieldUpdater<Auction, String>() {
@Override
public void update(int index, Auction object, String value) {
// The user clicked on the button for the passed auction.
}
});
Run Code Online (Sandbox Code Playgroud)